(Solved) – How can I get this code to work for mixed character/number or date fields?


I don’t really know anything about coding, but found this useful code on a forum, but it’s not working for any fields that have numbers or dates. I need the code to work for fields that have numbers and characters mixed and also for date fields. Any help would be appreciated. Here is the code:

Private Sub cboAmount_AfterUpdate()
Dim myAmount As String
myAmount = "Select * from Records where ([Amount] = '" & Me.cboAmount & "')"
Me.Records_subform.Form.RecordSource = myAmount
End Sub

Basically I have a search form that populates the search results in the attached subform so that searched records can be edited quickly from the search form.

Leave a Reply

Your email address will not be published. Required fields are marked *