One question. Instead of having a warning saying there is no ampersand at all message (now the MSG reads No Reverse Locations Exist for Addresses), I'm trying to figure out how to just have the button disabled if the TXT_DRCOG_Loc doesn't contain an "&".
I've tried
Code:
Private Sub Form_Load()If Me.TXT_DRCOG_Loc Like "* & *" Then
Me.BTN_Find_FlipDRCOG_Loc.Enabled = False
End If
End Sub
But that doesn't do anything.
Also tried to add it into the button itself before it runs the script
Code:
Private Sub BTN_Find_FlipDRCOG_Loc_Click() Dim sFlipped As String
Dim rst As DAO.Recordset
If IsNull(DRCOG_Loc) Then Exit Sub
sFlipped = fcnFlip(DRCOG_Loc)
If Len(sFlipped & vbNullString) = 0 Then
BTN_Find_FlipDRCOG_Loc.Enabled = False
'MsgBox "No Reverse Locations Exist for Addresses", vbInformation + vbOKOnly, " A D D R E S S O N L Y "
Exit Sub
End If
Set rst = Me.RecordsetClone
rst.FindFirst "DRCOG_loc = '" & sFlipped & "'"
If rst.NoMatch Then
MsgBox "This Location Has not been Reversed Yet"
Else
Me.Bookmark = rst.Bookmark
End If
rst.Close
Set rst = Nothing
End Sub
Neither seem to work. Also tried a few other examples I have found on the web (can't recall right now which ones they were)
, but nothing seemed to work...