Greetings,
I have a database of publications that are identified by hyphenated numbers (TMINs). I have a button on my main form which searches records by TMIN--works fine, as long as I remember the hyphens. (Basic button, created with the wizard.) Now I'm trying to code a button that will search on TMIN while ignoring any hyphens.
I'm not sure what this would involve.
- Saving the search query as a variable so it can be compared against the TMIN twice, with and without hyphens?
- Stripping the search query of hyphens, then comparing it to a hyphen-less version of the TMIN list (how? Would this have to be saved as another column of data?)
I'm not sure if it's even possible to be honest. Here's my total shot in the dark, cobbled together with something I found on Google. Needless to say, it doesn't work 
Private Sub BtnSearchFieldTMIN_Click()If IsNull(FieldTMIN) = False Then
TMIN_NoHyphens = Replace(Me.FieldTMIN, "-", "")
Me.Recordset.FindFirst "[Database Field]=" & TMIN_NoHyphens
Me!FieldTMIN = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!FieldTMIN = Null
End If
End If
End Sub
Any help would be greatly appreciated--even if it's just to tell me that it's impossible--thanks!