I am creating a step by step wizard, which means transferring variables to another form,
one issue I have is if the wizard takes a step back...
I need a snippet of code to tell the form where to get the variable from.
Here's what I have (that doesn't work) -
What this is supposed to do is check if Step1b is loaded then take the Address ID from there, if it's not then it's to assume "Customer Contact Details" is open, and instead take the address ID from there. But no avail.
fIsLoaded is a function I found which checks if the form is open or not,
However it's run in the onLoad event, which annoyingly runs after the old form has closed, so always returns false!
Any help will be appreciated... even if I'm doing this wrong, and I should restructure my wizard differently?
Dim ID As String
ID = me.Id
Open form
form.Id = ID
Close original form
one issue I have is if the wizard takes a step back...
I need a snippet of code to tell the form where to get the variable from.
Here's what I have (that doesn't work) -
Private Sub Form_Load()
If (fIsLoaded(Step1b) = True) Then
AddID = Forms!Step1b!AddressList.Column(2)
Else
AddID = Forms![Customer Contact Details]!AddID
End If
End Sub
What this is supposed to do is check if Step1b is loaded then take the Address ID from there, if it's not then it's to assume "Customer Contact Details" is open, and instead take the address ID from there. But no avail.
fIsLoaded is a function I found which checks if the form is open or not,
Function fIsLoaded(ByVal strFormName As String) As Integer
'Returns a 0 if form is not open or a -1 if Open
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> 0 Then
If Forms(strFormName).CurrentView <> 0 Then
fIsLoaded = True
End If
End If
End Function
However it's run in the onLoad event, which annoyingly runs after the old form has closed, so always returns false!
Any help will be appreciated... even if I'm doing this wrong, and I should restructure my wizard differently?