B
Bruce Rodtnick
I have a combo box with a row source from a table (cboTapeName). The
combo box has a row source from a table,
TapesNames, with two columns, TapeID (autonumber) and TapeName (text)
I've set the column count to 2 and the column
widths to 0";5". The bound column is 1.
I'm using DLookup to populate four other combo & text boxes:
Private Sub cboTapeName_AfterUpdate()
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "TapeID = " & Me!cboTapeName
' Look up product's unit price and assign it to UnitPrice control.
Me!cboTapeName = DLookup("TapeName", "TapeNames", strFilter)
Me!cboProducer = DLookup("Producer", "TapeNames", strFilter)
Me!cboVideographer = DLookup("Videographer", "TapeNames", strFilter)
Me!DateShot = DLookup("DateShot", "TapeNames", strFilter)
Me!Notes = DLookup("Notes", "TapeNames", strFilter)
Me!txtTapeID = DLookup("TapeID", "TapeNames", strFilter)
But when I run the form I get an error:
The value you entered isn't valid for this field.
For example, you may have entered text into a numeric field or a number
that is larger than the fieldsize setting permits.
When I change the column widths of the combo box (cboTapeName) to 1";5"
I don't have the problem, but then the ID shows
in the combo box and I don't want that.
Why is this happening?
I'm running 2000
Bruce Rodtnick
combo box has a row source from a table,
TapesNames, with two columns, TapeID (autonumber) and TapeName (text)
I've set the column count to 2 and the column
widths to 0";5". The bound column is 1.
I'm using DLookup to populate four other combo & text boxes:
Private Sub cboTapeName_AfterUpdate()
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "TapeID = " & Me!cboTapeName
' Look up product's unit price and assign it to UnitPrice control.
Me!cboTapeName = DLookup("TapeName", "TapeNames", strFilter)
Me!cboProducer = DLookup("Producer", "TapeNames", strFilter)
Me!cboVideographer = DLookup("Videographer", "TapeNames", strFilter)
Me!DateShot = DLookup("DateShot", "TapeNames", strFilter)
Me!Notes = DLookup("Notes", "TapeNames", strFilter)
Me!txtTapeID = DLookup("TapeID", "TapeNames", strFilter)
But when I run the form I get an error:
The value you entered isn't valid for this field.
For example, you may have entered text into a numeric field or a number
that is larger than the fieldsize setting permits.
When I change the column widths of the combo box (cboTapeName) to 1";5"
I don't have the problem, but then the ID shows
in the combo box and I don't want that.
Why is this happening?
I'm running 2000
Bruce Rodtnick