Requery Issues

timmeh01

New member
Local time
Tomorrow, 05:58
Joined
Sep 25, 2012
Messages
5
Hi all,
I am pretty new to Access and have already recieved some good advice from this forum (thanks kipcliff!).

I am having some issues with requerying a combobox on a form. I have two tables, tblPatient with pkUMRN (not autonumber, a 8 digit alphanumeric code) and tblAdmission with pkAdmissionID and fkUMRNAdmission (linked to tblPatient_UMRN).

The control on the form (frmMaster) is combobox tblAdmission_UMRNAdmission, and entering a known UMRN code autopopulates the form with data from tblPatient. Entering an unknown UMRN in to the tblAdmission_UMRN combobox starts a Not In List event macro that opens a form (frmNewPatient) for UMRN/tblPatient data entry as new record.

My problems are:
- I get the error notification "the text you entered isnt an item in the list" as the frmNewPatient pops up. How do I disable this error message?
- The frmNewPatient opens a new record. Is it possible to copy accross the UMRN entered in the frmMaster combobox tblAdmission_UMRNAdmission (ie the the unknown UMRN that initiated the Not In List macro) in to the tblPatients_UMRN control in the frmNewPatients? Or does it have to be re-entered manually?
- After I enter the tblPatients data via the frmNewPatient, save and close, the tblPatient updates but the combobox tblAdmission_UMRNAdmission doesn't update unless the frmMaster is closed and reopened. I have tried running requery macros linked to Event On Got Focus for frmMaster and Event After Update on the combobox. I have tried these requery macros both with and without UMRNAmission set as the control.

I have tried searching through the forums (and google!) and have seen many similar problems, but I have been thus far unable to implement the solutions suggested. Sorry if this has been answered before, any links for more infor would be appreciated, and thanks for you time!
 
The sample here demonstrates how items can be added to the Combo list using the Double Click event, and has explanations in the comments of the underlying code.
 
This is brilliant!
Sorted.
 

Users who are viewing this thread

Back
Top Bottom