var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Primary Key from one Form Autofills Foreign Key in another (NOT Sub form)
I have a Patient data entry form (PK NHS Number) and an Admissions data entry form (FK NHS Number)
Admissions is NOT a subform of Patient due to its size (it uses tab control and has 3 pages)
When Admissions opens I would like NHS Number from the Patient Form to Autofill NHS Number in Admissions and the focus to go straight to the next field (Patient ID - this is hospital reference)
I have looked at various similar threads but they don't seem to be quite what I need
(either that or I just don't have the VBA skills needed!!!)
No vba should be needed.
Select a patient from a list in a search form, like frmPatient
Then use that pick to open the Admiss form using that patient chosen...
docmd.openform "frmAdmissions", , , "[patientID]=" & Forms!frmPatient!txtPatID
Thanks ranman but I don't have (or want) a search form - just want users to enter data with this form so have made it Data Entry = Yes
When a new patient is added using the Patient data entry form a faux Save Button opens up the New Admissions data entry form so the new patient can be admitted
Could your suggested code be added to the On Load or On Open events of the Admissions form?
I have tried a very similar piece of code before but got an error message (was a day or two ago so cant remember exact wording)
The end part txtPatID looks new - what does that do?