Sam Summers
Registered User.
- Local time
- Today, 12:47
- Joined
- Sep 17, 2001
- Messages
- 939
Hi Guys,
I have two comboboxes "TOSubSection" and "DROPSSubSection" that are both not visible until the user selects a client from another Combobox "ClientName".
If they select the name Transocean then "TOSubSection" becomes visible and if they select any other name then "DROPSSubSection" becomes visible. Depending on the client selected either the form "EnterItemTransocean" opens or the "EnterItemDROPS" form opens.
I am using the code below which works fine for Transocean but nothing happens for the rest?
I think I am just missing something but cant seem to crack it?
Many thanks in advance
I have two comboboxes "TOSubSection" and "DROPSSubSection" that are both not visible until the user selects a client from another Combobox "ClientName".
If they select the name Transocean then "TOSubSection" becomes visible and if they select any other name then "DROPSSubSection" becomes visible. Depending on the client selected either the form "EnterItemTransocean" opens or the "EnterItemDROPS" form opens.
I am using the code below which works fine for Transocean but nothing happens for the rest?
I think I am just missing something but cant seem to crack it?
Many thanks in advance
Code:
Private Sub TOEnterByAll_Click()
On Error GoTo TOEnterByAllBtn_Click_Err
Dim stDocName As String
Dim stLinkCriteria As String
ClientName.SetFocus
If Forms!Main!SetClient.Value = "Transocean" Then
If IsNull(SelectArea) Or IsNull(SelectSection) Or IsNull(TOSubSection) Then
DoCmd.Beep
MsgBox "You must select all the locations first.", vbExclamation, "Incomplete options selected!"
Else
If IsNull(SelectArea) Or IsNull(SelectSection) Or IsNull(DROPSSubSection) Then
DoCmd.Beep
MsgBox "You must select all the locations first.", vbExclamation, "Incomplete options selected!"
End
End If
SetClient.SetFocus
If Forms!Main!SetClient.Value = "Transocean" Then
DoCmd.OpenForm "EnterItemTransocean", , , stLinkCriteria
Else
stDocName = "EnterItemDROPS"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
TOEnterByAllBtn_Click_Exit:
Exit Sub
TOEnterByAllBtn_Click_Err:
MsgBox Error$
Resume TOEnterByAllBtn_Click_Exit
End If
End If
End Sub