jmbcreative
Technical User
I have an event that has an if statement. Within the "then" statement of that "if" statement I need a second "If" statement to return a value. How do I do this?
I keep getting a compile error on the second if Statement.
Here is what my code looks like now:
**************************************
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Me.System.Value = Form_ChangeLogEntry.System.Value
Me.Location.Value = Me.Combo26.Column(2)
DoEvents
If Form_ChangeLogEntry.Type.Value = "Add System" Then
Dim strMax1
strMax1= If(DMax("[ControlID]","HardwareList") > DMax("[ControlID]","HardwareAdd"), 1+ DMax("[ControlID]","HardwareList"), 1+ DMax("[ControlID]","HardwareAdd"))
Me.ControlID = CStr(Val(strMax1))
****************************************
I keep getting a compile error on the second if Statement.
Here is what my code looks like now:
**************************************
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Me.System.Value = Form_ChangeLogEntry.System.Value
Me.Location.Value = Me.Combo26.Column(2)
DoEvents
If Form_ChangeLogEntry.Type.Value = "Add System" Then
Dim strMax1
strMax1= If(DMax("[ControlID]","HardwareList") > DMax("[ControlID]","HardwareAdd"), 1+ DMax("[ControlID]","HardwareList"), 1+ DMax("[ControlID]","HardwareAdd"))
Me.ControlID = CStr(Val(strMax1))
****************************************