473,470 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form not displaying when new record is added

9 New Member
Hi there

I have the following problem, and I was hoping that somebody might be able to show me where I'm going wrong.

I have a form - Form1, say - that takes its data from three tables: facs, which is a list of health facilities, and two tables which just contain data. I have a second form - Form2 - which lists the health facilities, and for each health facility there is a command button which opens up Form1 for the relevant facility.

I have code that checks whether a record for the selected facility exists in the two tables. If so, clicking the button opens Form1 filtered on the selected facility, as expected. If not, clicking the button should open the form and present a blank record; however the form is too blank - none of the controls are visible!

Here is the code for the command button - nothing too controversial!

Expand|Select|Wrap|Line Numbers
  1. If Me.coa = 1 Then
  2.     DoCmd.OpenForm "Form1", , , "[facs.HID] = '" & Me.hid & "'", acFormEdit
  3. ElseIf Me.coa = 0 Then
  4.     DoCmd.OpenForm "Form1", , , "[facs.HID] = '" & Me.hid & "'", acFormAdd
  5. End If
  6.  
I have tried this for when Form1 is based only on the table facs and one data table, and it has worked fine. I'm feeling very bamboozled!

This is the SQL on which Form1 is based - I think the problem must be here, but I'm not sure.

Expand|Select|Wrap|Line Numbers
  1. SELECT facs.hid, facs.fac, ab.hid, ab.a, ab.b, cd.hid, cd.c, cd.d
  2. FROM (ab INNER JOIN cd ON ab.hid = cd.hid) INNER JOIN facs ON (cd.hid = facs.hid) AND (ab.hid = facs.hid);
Any advice would be most gratefully received, and I'd just like to say how much I've learnt from just browsing the forum here, so thank you very much to everyone who contributes.
Mar 10 '08 #1
0 1265

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
3
by: Earthling | last post by:
Any help would be appreciated to solve the following simple problem that I will describe. *** There is a form called "red chocolate form". The form has a particular subform field that has a...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: Lyn | last post by:
Hi, I am working on a genealogy project in which I have two tables: Person -- one record for each person in the family. Each record has a unique Autonum field (IDPerson). Partnerships -- one...
7
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
4
by: Krzysztof Bartosiewicz | last post by:
Hi! I haven't been using Access for a very long time and I forgot everything :) I will be very greatful for help since I have been fighting with this problem for a few hours... I have three...
13
by: David W. Fenton | last post by:
I've been struggling the last two days with something I thought was very easy, which is to open a web page with a form on it and populate the form with data passed in a query string (either POST or...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.