Combo box can not update record

  • Thread starter Antonio Contreras via AccessMonster.com
  • Start date
A

Antonio Contreras via AccessMonster.com

I am using Access from Office Professional 2000

I have a table with 13 field, table A. I have prepared a form to create new
records. Two items on the form are dropdowns that lookup values in another
table B and store the entry selected in table A. The form worked as
required.

I created a new table for another look up item, table C. I added a
column/field to table A for the id to be obtained from table C.

I created the new dropdown, and was able to select the data from table C to
show in the dropdown.

However, I can't seem to be able to bound the new dropdown to the new
field. Further, the new field does not show on the field list, nor does it
show in the list you get when choosing the dropdown properties, data
control sources.

I have compared the dropdowns that work to the one that doesn't and I can't
see any significant differences. Since I haven't touched Access in years, I
am quite lost.
 
G

Guest

It is possible that the source of your form has a query as a record source,
verify that the query contains the field that you added to the table,
 
J

Josh Nankivel via AccessMonster.com

I agree, make sure your form doesn't have a bound recordset. To update
your table, use something like the following behind a submit button instead.

--------------------------------------------

Dim rst As Recordset
Dim mdbLocal As Database

Set mdbLocal = DBEngine(0)(0)
Set rst = mdbLocal.OpenRecordset("tblName", dbOpenDynaset,
dbAppendOnly)
rst.AddNew

With rst
!strField1 = Me!control1
!strField2 = Me!control2
!strField3 = Me!control3

End With

rst.Update
rst.Close
Set mdbLocal = Nothing

''' Reset form controls to null, set focus
''' to first control

Me!control1 = ""
Me!control2 = ""
Me!control3 = ""
Me!control1.SetFocus
 
A

Antonio Contreras via AccessMonster.com

Yes, I stumbled on the answer last night quite by accident, when I had the
field list open and selected, and happend to hit properties. I then noticed
the query did not have the new fields in the select.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top