Open Query into Form View

S

scarlo

I would like to run my query, but have it open into form view- an
suggestions?

*I don't want filter by form, or query-by-form, I want the info tha
would come up for the query already completed "MsterQry1" to be show
in the form
 
N

Nikos Yannacopoulos

In the database window, select your query (without opening it) and run
menu item Insert > Autoform. This will automatically create a form based
on the query.

HTH,
Nikos
 
S

scarlo

Only, I'd like the information to open in an already existing form.
My bosses "very much prefer" that I have my already in-place "ad
contacts" form have the option to be driven by my advanced query...

Is this possible, or do I need to create a new form that just "looks
exactly like the other form
 
N

Nikos Yannacopoulos

I don't know how knowledgeable your boss is on Access, but he's right
about one thing: don't replicate similar objects for similar jobs, when
one can do both - and it this case it seems that it can.

You can assign a form's recordsource on the fly upon opening it (which
means you have "decided" what it will be before opening it), or change
it while it is open. So there are several ways you can build this into
your user interface.

If you are using a switchboard, or opening the form from a command
button on another form, you could either have two separate command
buttons, or use an option group (radio buttons) in conjunction with a
single command button, to select the desired recordsource before opening
the form.

Alternatively, you could have an option group on the form itself
(preferably in the header section) to change the recordsource on the
fly, once the for is open.

Tell me what you prefer, with details on the two alternative
recordsources, ideally pasting the SQL for the existing form
recordsource (from the forms RecordSource property, tab Data) and the
SQL for the saved query, as well as the name of the existing form, and
I'll give you more details.

HTH,
Nikos
 
D

DrewTheFather

I would also like to know how to do this. I have already made a query. How
do I display the values within the query into text boxes on a form?

Here is the existing code I have:

Private Sub BC_Search_AfterUpdate() ' The Code for the 'Search By BarCode'
option

Dim ThisDb As Database, Thisrec As Recordset

Set ThisDb = CodeDb() ' Current MDB
Set Thisrec = ThisDb.OpenRecordset("Select * From [Computer Query] Where
[BarCodeData] ='" & Me.BC_Search & "'")

If [Computer Query] = criteria Then
Me.Service_Tag = Thisrec.Computer_ID
Me.Brand = Thisrec.PC_Brand
Me.cboPCType = Thisrec.Type_Name
Me.Model = Thisrec.PC_Model
Me.Date_Issued = Thisrec.Date_Issued
Me.Lease_Date = Thisrec.Lease_Exp_Date
Me.Image_Version = Thisrec.Image_Version
Me.cboStatType = Thisrec.Status
Me.SCIF_Barcode = Thisrec.BarCodeData
End If

End Sub


Instead of using the query fields to assign the values to be displayed in
the text boxes, would it be similar to using the call to a "Column" of a
combo box? If not, how would I call the values/fields from a query?

Please help...
 
Top