Problem 1)
I am trying to edit a field in a table using a subform, in my original table I have a combo box in the field I want to edit, but when in subform view, I don't get the combobox option. Any Ideas?
Problem 2)
As an alternative, I have created a form with a subform and copied a vb script to search and edit the different fields (code below) When I search by ID (primary key) I get a result in my subform which will then allow me to edit fields, including my combobox. However, when I search by serial number, nothing populates the subform, although I know the serial number is in the table. Any ideas please...
Private Sub cmdSearch_Click()
On Error GoTo errr
Me.SerialNumberssubform.Form.RecordSource = "SELECT * FROM SerialNumbers " & BuildFilter
Me.SerialNumberssubform.Requery
Exit Sub
errr:
MsgBox Err.Description
End Sub
Private Function BuildFilter() As Variant
Dim varWhere As Variant
Dim tmp As String
tmp = """"
varWhere = Null
If Me.ID > "" Then
varWhere = varWhere & "[ID] like " & Me.ID & " AND "
End If
If Me.SerialNumber > "" Then
varWhere = varWhere & "[SERIALNUMBER] like " & tmp & Me.SerialNumber & tmp & " AND "
End If
If IsNull(varWhere) Then
varWhere = ""
Else
varWhere = "WHERE " & varWhere
If Right(varWhere, 5) = " AND " Then
varWhere = Left(varWhere, Len(varWhere) - 5)
End If
End If
BuildFilter = varWhere
End Function