E
Erik Svensson
Hi
I have a form with a subform (shown as a list) and I am trying to make a
button that takes the number in the active record in the subform and put it
in the textbox with the lowest number available. I have created 9 textboxes
where the first is named Module_entry and the rest is named Module1, Module2
...... I am using the Module_entry text box to retrieve the information from
the subform and then I want the button to take the active record and place
that number in the lowest Module# box that is available. This is the code I
have for the moment and it does not work. The error say "Compile error: Else
without IF"
Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
Me.Module_entry = Me![CUSTOM quote module search form
subform]![Pseudo_Number]
If Module1 = "" Then Module_entry = Module1
ElseIf Module2 = "" Then Module_entry = Module2
ElseIf Module3 = "" Then Module_entry = Module3
ElseIf Module4 = "" Then Module_entry = Module4
ElseIf Module5 = "" Then Module_entry = Module5
ElseIf Module6 = "" Then Module_entry = Module6
End If
Me.Module_entry = Null
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub
BR/Erik Svensson
I have a form with a subform (shown as a list) and I am trying to make a
button that takes the number in the active record in the subform and put it
in the textbox with the lowest number available. I have created 9 textboxes
where the first is named Module_entry and the rest is named Module1, Module2
...... I am using the Module_entry text box to retrieve the information from
the subform and then I want the button to take the active record and place
that number in the lowest Module# box that is available. This is the code I
have for the moment and it does not work. The error say "Compile error: Else
without IF"
Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
Me.Module_entry = Me![CUSTOM quote module search form
subform]![Pseudo_Number]
If Module1 = "" Then Module_entry = Module1
ElseIf Module2 = "" Then Module_entry = Module2
ElseIf Module3 = "" Then Module_entry = Module3
ElseIf Module4 = "" Then Module_entry = Module4
ElseIf Module5 = "" Then Module_entry = Module5
ElseIf Module6 = "" Then Module_entry = Module6
End If
Me.Module_entry = Null
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub
BR/Erik Svensson