Updating a form with Combobox

ScottF

Registered User.
Local time
Today, 14:07
Joined
Mar 10, 2003
Messages
20
I have try everthing to update my form with a combo box.
I try setting the Form resource to a Query and Table. I have my Combo box Resource set to a query and it work fine, but when I change it the table does not update to the combo box text. The combo box has the Rep Number in it. The form is set to RepInformation Table with fields Address, city etc.
 
I am not real sure what you are trying to say, but the way a ComboBox works is the BOUND column has to match the data in the underlying table/query for it to bring up a match in it's display. So if it is not "working", than the bound column of the ComboBox is not finding a match to it's bound column in the table/query. I would double check all that first.
 
I combo is being populated by a Query and I can see all the Rep number or Rep ID but when I go to click on one of the Rep Number it does not update the bound text box on the form. The combo box is bound to Rep Number in the RepInformation Table either.
 
I have even try place this SQL statement in the combo box change event but is say I hve a Data Mismatch. The dat type for the Rep Number is Number and a in the SQL statemnet is a integer.
Dim rst As Recordset
Dim strSQL As String
Dim a As Integer
a = Forms![RepInformation]![RepNumber]
Set rst = CurrentDb.OpenRecordset("Select * from RepInformation where [Rep Number] = " & a & ";")
Me.Recordset = rst
rst.Close
 
I figure it out you have to have a macro to update the table
 
No, you don't need to use a macro to update the table. You simply need to fix the combobox so that it is bound to the correct field. Make sure that the ControlSource of the combo refers to the table field where the selection will be stored.
 

Users who are viewing this thread

Back
Top Bottom