Trouble opening a pop-up form

abcibula

Registered User.
Local time
Today, 07:36
Joined
May 14, 2012
Messages
11
I have a form with a field for "Account Number" and would like to have a form pop up when you click on the number in the field.

I figured out how to use a macro to open the pop-up form when you double click the field, but all of the records pop up. I would like for only the records that are linked to the account number that was clicked to be returned.

I need to know what to enter in Filter name and Condition so that only the specific records will be included in the pop up.

Thank you
 
The code would look something like the following;

If the Account Number field is a Number data type then -

DoCmd.OpenForm "YourForm", , , "[Account Number] = " & Me![Account Number]

If it is text then -

DoCmd.OpenForm "YourForm", , , "[Account Number] = '" & Me![Account Number] & "'"
 
That worked perfectly...thank you.

Is there any way to get the Account Number field to auto-populate when you enter a note in the pop-up form?
 
Is there any way to get the Account Number field to auto-populate when you enter a note in the pop-up form?

Not sure I'm following you. If you're using the account number in the criteria to open the form, then that account number should already be displayed in the pop-up form when opened (assuming you have a text box on the pop-up form bound to the account number field).
 
I guess I am unsure how to get the text box on the pop-up form bound to the account number field. Once you enter the account number, those notes show up, but when you enter a new note, the account number is not automatically there.
 
Last edited:
Well, if you want to add new records, then this would be simpler if you used a subform on your main form to display the notes. That way, the Master/Child Link of the subform control would manage the insertion of the account number in the foreign key field of the Notes table when you add a new record. If you are set on using the pop-up form, then you're going to have to store the account number in a variable upon opening the form, then use the forms Before Update event to put the appropriate account number (which is stored in the variable) in that field before the record is saved.
 

Users who are viewing this thread

Back
Top Bottom