Michael,
First, I would say if you are using "Macros", Stop and do your self a favor and use VBA. I could not tell you how to write one simple macro, and I do not plan on learning.
Second, this should be pretty easy, but give a little more details. Your question is very general and I could think of about 10 ways to do it. Not all may fit what you really need.
I currently have a report that prints a quote based on a query which has a question attached to the QuoteNo field. The operator enters the quoteno when printing the report and one quote is printed. I'm trying to write code that will print several quotes in a loop by using a form with a start and end quote no. I would like to assign the quote number to the field in the query so it will print the quotes as they are looped through in succession by the program
Still a little confused. Let me see if I got it. You have a query (I will call it "qryQuote"), and it has a field "QuoteNo". This field has a parameter in the criteria, something like "[Enter Quote Number]". You enter a quote number a the report returns one record.
1) When you say "print several quotes in a loop", what exactly do you mean? Can it be a report with several quotes on it?
2) What do you mean by this, " would like to assign the quote number to the field in the query"? By assign do you mean show the number, or do you mean write to the table? There is already a field QuoteNo with a value, so what is assigned to what?
I am guessing here, but I think that you want to pop up a form that allows the user to choose a start and stop number. Once the user chooses the criteria, the report is written with those quotes on it. Is that it? If that is the case there is not looping or writing to a table.
1. Simply build your form "frmSelect" with two controls, for demo purposes I used text boxes "txtBxBegin and txtBxEnd", but you would probably use some kind of pull down list.
2. You could then put this in your criteria of the query
Between ([forms]![frmSelect]![txtBxBegin]) And ([forms]![frmSelect]![txtBxEnd])
or use this in the criteria argument of the openReport command.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.