Hello,
There are two linked tables: “tblRuns” (primary key Run_name) and “tblVariants (also contains Run_name but not as a primary key). There are two continuous forms representing each table.
There is a textbox next to each record on frmRuns. When the textbox is clicked, I expect to open frmVariants and display variants for that particular run.
Also, I need to pass selected “run_name” value from frmRuns to a textbox “txtCurrentRun” on frmVariants.
When I use the following code I get prompted to enter parameter value for query and after I enter the parameter value I get “Object required” error at frmVariants.txtCurrentRun.Value = Me.Run_Name.
I don’t understand why I get prompted to enter a parameter, also, please explain how to pass the run_name to a textbox. Thank you very much.
Here is the code:
There are two linked tables: “tblRuns” (primary key Run_name) and “tblVariants (also contains Run_name but not as a primary key). There are two continuous forms representing each table.
There is a textbox next to each record on frmRuns. When the textbox is clicked, I expect to open frmVariants and display variants for that particular run.
Also, I need to pass selected “run_name” value from frmRuns to a textbox “txtCurrentRun” on frmVariants.
When I use the following code I get prompted to enter parameter value for query and after I enter the parameter value I get “Object required” error at frmVariants.txtCurrentRun.Value = Me.Run_Name.
I don’t understand why I get prompted to enter a parameter, also, please explain how to pass the run_name to a textbox. Thank you very much.
Here is the code:
Code:
[FONT=Calibri]Private Sub First_Review_Completed_Click()[/FONT]
[FONT=Calibri] 'if record exists show correspondin records in 'frmVariants'
DoCmd.OpenForm "frmVariants", _
WhereCondition:="Run_Name=" & Me.Run_Name
frmVariants.txtCurrentRun.Value = Me.Run_Name
[/FONT][FONT=Calibri]End Sub[/FONT]