Passing data into vba from a form

Peter Bellamy

Registered User.
Local time
Today, 10:08
Joined
Dec 3, 2005
Messages
295
I have some code running from a button on a form.
It runs several queries updating records and outputing some text files.

I want a neat way of passing a date into one of the queries.
Does anyone have a suggestion?

Thanks
 
In Query criteria put;
[Forms]![FormName]![FieldName]
 
The problem with the above method is that the query becomes unique to tyhe form. It cannot be run if the form is not open and there is a value in the field.

Here is a link to a method that I find more versatile.
 
Thanks both.

I had allready used the Forms.FormName.FieldName method and opening the Form in the code prior the queries, but it does not stop on the form but go straight through !

David. Your code seems similar and as you say more flexible by using functions.

My problem seems to be stopping the code for the form to provide the input.
 
When you say "passing a date into the queries" are you actually wanting to use the date as a filter option? or the value for a field? Bit more info please.
 

Users who are viewing this thread

Back
Top Bottom