I have a combobox in an access form that I want to pull in dates from a table. When I click on the dropdown for this combobox it is blank. Below are the pieces that relate to this dropdown. I assume it has something to do with the format. Is my problem that I'm declaring it as a string each time and it should be something else?
Private Sub cboLastLogin_AfterUpdate()
Dim myLogin As String
myLogin = "Select * from tbl_users where ([LAST_LOGIN] = '" & Me.cboLastLogin & "')"
Me.tbl_users_subform.Form.RecordSource = myLogin
Me.tbl_users_subform.Form.Requery
Me.cboUnitName = Null
Me.cboUserType = Null
Me.cboSSAAR = Null
Me.cboLastName = Null
End Sub
If IsNull(Me.cboLastLogin) Then
strLastLogin = "[LAST_LOGIN] like '*'"
Else
strLastLogin = "[LAST_LOGIN] = '" & Me.cboLastLogin & "'"
End If
Dim strUserType, strSSAAR, strLastName, strLastLogin, strUnitName As String
Private Sub cboLastLogin_AfterUpdate()
Dim myLogin As String
myLogin = "Select * from tbl_users where ([LAST_LOGIN] = '" & Me.cboLastLogin & "')"
Me.tbl_users_subform.Form.RecordSource = myLogin
Me.tbl_users_subform.Form.Requery
Me.cboUnitName = Null
Me.cboUserType = Null
Me.cboSSAAR = Null
Me.cboLastName = Null
End Sub
If IsNull(Me.cboLastLogin) Then
strLastLogin = "[LAST_LOGIN] like '*'"
Else
strLastLogin = "[LAST_LOGIN] = '" & Me.cboLastLogin & "'"
End If
Dim strUserType, strSSAAR, strLastName, strLastLogin, strUnitName As String