D
DanielS
I know this question has been asked before because I have
read the responses and tried the suggestions, but I am
still stuck.
I have a series of 10 forms set up for gathering
information about a certain manufacturer. The user
enters the manufacturer's name on the first form and then
I want all of the following forms to display that name
(so it is very clear for my users what company they are
entering information for). So basically, I need to pass
the value to the next form and display it there. Please
help!
Below is the most recent trick I tried, but it didn't
work:
(I know it didn't work because on I never have a value
displayed on Form 2, and as soon as the AfterUpdate is
run on Form 1, I get a type mismatch error).
Form 1:
Option Compare Database
'Current Manufacturer variable
Dim strCurrMfr As String
Public Function CurrMfr() As String
'Public Function stores value of private variable
CurrMfr = strCurrMfr
End Function
Private Sub MfrName_AfterUpdate()
On Error GoTo Err_MfrName_AfterUpdate
'set Current Manufacturer Variable
strCurrMfr = Str(Me.MfrName.Value)
CurrMfr
Exit_MfrName_AfterUpdate:
Exit Sub
Err_MfrName_AfterUpdate:
MsgBox Err.Description
Resume Exit_MfrName_AfterUpdate
End Sub
Form 2:
I have an unbound text box where Control Source: =CurrMfr
()
read the responses and tried the suggestions, but I am
still stuck.
I have a series of 10 forms set up for gathering
information about a certain manufacturer. The user
enters the manufacturer's name on the first form and then
I want all of the following forms to display that name
(so it is very clear for my users what company they are
entering information for). So basically, I need to pass
the value to the next form and display it there. Please
help!
Below is the most recent trick I tried, but it didn't
work:
(I know it didn't work because on I never have a value
displayed on Form 2, and as soon as the AfterUpdate is
run on Form 1, I get a type mismatch error).
Form 1:
Option Compare Database
'Current Manufacturer variable
Dim strCurrMfr As String
Public Function CurrMfr() As String
'Public Function stores value of private variable
CurrMfr = strCurrMfr
End Function
Private Sub MfrName_AfterUpdate()
On Error GoTo Err_MfrName_AfterUpdate
'set Current Manufacturer Variable
strCurrMfr = Str(Me.MfrName.Value)
CurrMfr
Exit_MfrName_AfterUpdate:
Exit Sub
Err_MfrName_AfterUpdate:
MsgBox Err.Description
Resume Exit_MfrName_AfterUpdate
End Sub
Form 2:
I have an unbound text box where Control Source: =CurrMfr
()