Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manually input values on field from query 1

Status
Not open for further replies.

PikPim

Programmer
Jul 25, 2006
15
CA
Hi guys,
I would like to know how can define a value in a field (with the action DefineValue from the macro action list) from a value found in a query.... When i try to input a field from the query in question, I get an error saying that "the objet does not containt a automatisation object named 'thenameofmyquery'" I created the expression with the expression creator so it should be good but it isn't ! help me plz!
note: maybe the terms aren't exact because all of this is translated from the french errors but the problem stays the same! :p
 
Here are some details:
I converted the macro to vb code and it gives me this:

With CodeContextObject
Forms!Produit!txtDateDebut = VersionValidation.Date_début
End With

Which doesn't work. I would like to know what is the correct syntax to get the field "Date_début" from the Query "VersionValidation
 
If you need a single value from a table or query you can use a dlookup.

Forms!Produit!txtDateDebut = dlookup("Date_début","VersionValidation")

I assume your query only has a single record in it. If not the third parameter of the dlookup is a where criteria withou the word "Where"
ex
dlookup("Date_début","VersionValidation","[versionID] = " & me.txtBxVersionID)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top