I am trying to add some more data and functionality to an existing database and having trouble figuring out how to pass the value that is being passed to main form also to the sub form. The reg# on main form is unbound. The reason the Reg# is passed as a variable I think is because that variable is used to get data from external data source.
From the frm_SalesTeam, double click on Reg# opens frm_SalesDriverInfo
Private Sub Reg___DblClick(Cancel As Integer)
Dim reg As String
reg = Me![Reg #]
DoCmd.OpenForm "frm_SalesDriverInfo"
Form_frm_SalesDriverInfo.tex_RegNum = reg
End Sub
Now in frm_SalesDriverInfo form I also want to display associated notes and the idea is to have a sub form for the notes but I don’t know how to pass the reg# to the sub form frm_SalesNotes to display associated notes as the frm_SalesDriverInfo opens. If it is easier to add a button "get notes" that would be ok also.
I really do not know VB so if you can help, please dumb it down for me
From the frm_SalesTeam, double click on Reg# opens frm_SalesDriverInfo
Private Sub Reg___DblClick(Cancel As Integer)
Dim reg As String
reg = Me![Reg #]
DoCmd.OpenForm "frm_SalesDriverInfo"
Form_frm_SalesDriverInfo.tex_RegNum = reg
End Sub
Now in frm_SalesDriverInfo form I also want to display associated notes and the idea is to have a sub form for the notes but I don’t know how to pass the reg# to the sub form frm_SalesNotes to display associated notes as the frm_SalesDriverInfo opens. If it is easier to add a button "get notes" that would be ok also.
I really do not know VB so if you can help, please dumb it down for me
Last edited: