Passing a value to a pop up form

nosferatu26

Registered User.
Local time
Today, 18:15
Joined
Jul 13, 2015
Messages
57
Hi, I have a form and in the subform for that I have a button that opens a pop up form. I want to pass the value [ACB ID] to an unbound text box in the popup form but I am having trouble. My code for the button in the subform is:

DoCmd.OpenForm "addPartNumberMod", acNormal, , "ACB = " & Me.[ACB ID], WindowMode:=acDialog

Currently when I press the button it asks me to enter the acb value instead of carrying it over. Also, when i do type in a number into the dialog, when the form opens, the text box is blank.

Thank you very much for your help
 
Instead of unbound, bind the form to a table/field.
fill the field with [abd id]
popup
 
I got it to work, thank you.

I am having another issue now, the main purpose of that pop up form is for the user to add a new part number to the database and also to a listbox which is back on the other form. I have the acb id passed over and stored in that textbox, but when the line "DoCmd.GoToRecord , "", acNewRec" executes, it resets the acb id textbox along with the other values. Do you know how to get that value to remain unchanged?
 
dont use newrec.
or
post the value to a 'working' table, the popup uses only this table.
user makes changes,
clicks save.
Then an append query appends his entries to the 'main' table , (equivalent of a new rec)
 
thanks for your responses; I was able to make it work by creating a dummy unbound text box and before newrec was called I set the dummy textbox = to the bound acb textbox. I then referenced the dummy one in my query.

regards
 

Users who are viewing this thread

Back
Top Bottom