TRYING to create a simple select query

BadKitty

Registered User.
Local time
Yesterday, 22:33
Joined
Jul 7, 2005
Messages
55
i've created a database for city permits to be issued (which works perfectly thanx to alll your help), but now i need to be able to print out 1 permit at a time when it is issued (immediately after the data has been entered into the forms). i have 3 tables & 3 forms: contractors/owners, permtOrders (which has tabs for the different types of permits), and permitOrderDetails - each form has a button to open the next. now i need to be able to print an actual permit (like the carbon copy, landscape kind that usually tears out of a book). once the user enters the information into the forms, i need a little bit of that info from each form to be carried onto the actual printable permit. i've tried to create a query w/data from the 3 tables, but it isn't returning any results. the relationships between the tables were crreated w/the wizard & i've tried created the query a couple of different ways. help :confused:

also (i know...i'm dumb), if someone could tell me how to take a snapshot of my query it would help w/my explanation of this problem. i only know how to do this w/a report.

thanx in advance :)
 
You will probably have less trouble if you make a report with subreports for the other two tables.
 
xplainy

not exactly sure if that's what i need. let me summarize my 1st idea:

is there any way to carry specific data entered by the user from 3 forms to one printable form which is set up like a city permit? ideally, i'd like the user to be able to click on a button to open the permit & then click print after having entered all the data into the 3 forms (1st form opens 2nd; 2nd opens 3rd).
ie - a contractor comes in & applies for a permit, the user (permit clerk) enters all the contractor's info into form 1 then clicks permit & enters the info for that specific permit (there are 4 types) into form 2, then clicks payment & enters check #, fee, etc. into form 3. the permit should now be issued but only needs to have permit # & type (which i've combined as 1 expression in a query so it looks like h104 or m798), contractor name, date, location, & amount paid on it. is this possible? i've tried building a query to base a report on with that info but am not getting the results i want, and i don't know how to have a report display only one permit at a time. :confused: plus, my users don't want to have to run a query & then print a report. they just want to click print after entering the data (they're very lazy, set in their ways, and not very computer literate). basically, i'd like to migrate info from 3 forms & 1 query onto the 1 printable form. please excuse my lack of knowledge on this subject :o but the whole application is up & running except for this last part. please help! thanx in advance. :)
 
Last edited:
Forms are not optimized for printing. You need to use a report. There is no reason to run a query separately. Reports and forms both use queries as their RecordSources. When you open a report/form bound to a query, the query is run automatically to obtain the data for the report/form.

To select a particular record for a form/report, use the where argument of the OpenForm or OpenReport Method/Action.
 
thank you...everything's working fine. since i have 4 types of permits, i have 4 different reports based on 4 different queries. they return, say, all the hydrant permits, or meter permits, etc. could you give an example of the where argument?

since i have a print permit button on the payment (last) form (which opens the report), is there a way i could prompt the user so they can print current record (which will usually be the case) or choose another permit?

also, i have 1 'print permit' button on my payment form but 4 reports, how can i specify which report to open or do i need seperate buttons?

sorry to be such a pain, but you've been a big help throughout this whole project...i've used every suggestion you've given me & they've all worked perfectly. thanx again! :)
 
could you give an example of the where argument?
Syntax is available from help. Usually the where argument will be a single field:

"SomeField = " & Me.SomeField

If the field is text:

"SomeField = '" & Me.SomeField & "'"

If the condition requires more than a single field:

"SomeField = " & Me.SomeField & " AND SomeOtherField = " & Me.SomeOtherField

To allow the user to select the record to print, add a combo to the form and use that combo as the criteria.

If you can tell from the data which report to print, use a Select Case statement.

Code:
Select Case Me.PermitType
    Case 1
        strReportName = "permit1"
    Case 2
        strReportName = "permit2"
...
    Case Else
        MsgBox "No permit type selected", VBOKOnly
        Exit Sub
End Select
 
If you are not familiar with SQL, the WHERE argument is produced by putting a criterion in the query grid.
 

Users who are viewing this thread

Back
Top Bottom