Should I use a subform

gguy

Registered User.
Local time
Today, 06:04
Joined
Jun 27, 2002
Messages
104
In a form I have a field called agency ID. When the user enters this agency ID I want the name, address, city, state and zip to appear below the agency ID in read only format.
The agency ID field on the form is bound to a table called standards. The table with the agency name, address, city, state and zip is called agency and this table does also have a field called agency ID. I have made a one to many relationship between the agency ID on the agency table and the standards table agency ID field.
When I enter an agency ID on the form I want an error to appear if that number does not exist in the agency table. If it does exist I want it to list name, adress ect. on the form and allow the number to be recorded in the standards table agency ID field.
I have created a subform and it will show this data but only after I come back from the design view side.
Whats the best way to get this accomplished? Thanks, GGuy
 
Gguy

You need to run a requery in your after update property of your agencyID.

Me!SubFormName.Requery

That should fill your subform everytime you make a change.

It might work for you to add another subform with your address info.

Tom
 
Hey, thanks, the requery function worked great but I still need a little help getting the agency ID to not allow an entry when the entry does not match an agency ID in the Agency table.
I figure I will need to add another function, like an if statement, in the after update and if the entry is not found then clear the original entry and leave the cursor there waiting for a correct entry.
Thanks again, GGuy
 

Users who are viewing this thread

Back
Top Bottom