Rafa3lOneiL
Rafa3lOneiL

Reputation: 89

Access Update table with selected value from a combobox in form

good morning, I'm breaking it up with a simple thing

I have a form access that contains a combobox called cboHora and I want to simply update my table (tbEntry) with the value selected in the combobox

enter image description here

Call my query with vba : DoCmd.OpenQuery "Consulta1"

enter image description here

But even fill in the combobox before running the query, the following error appears:

enter image description here

My latest attempt

enter image description here

Can you help me?

Upvotes: 0

Views: 2446

Answers (1)

Minty
Minty

Reputation: 1626

You can't use Me. to reference a form object in a query, you have to use the

[forms]![YourFromName]![YourControlName] 

syntax. The expression builder will get you there if you examine the objects. The form must be open in normal view (not design view) when the query is run.

Upvotes: 1

Related Questions