Split form with search criteria

B

BrookieOU

I would like to create a form that has drop-down boxes on the top where a
user can choose criteria (i.e. Management Group, Pay Period Start and Pay
Period End) and have the relevant information show in a window underneath (I
think this would be done with a split/subform).

I can set up a form to gather criteria information from a query and open a
report. But, I this isn't exactly what I want because I want the information
to all show up in the same window. Any help?

Thanks,
Brooke
 
J

jsv2002

There are several ways to shoe information but this would depend on what is
the resultant information you want to show e.g just a text box with a block
of text or several fields of information depending on selection in the drop
down boxes.

Also would you want the combo boxes to cascade filter? in other words when
you have say selected the management group restrict the second combo box
selection to people within that group?

Any way say you 3 combo boxes named cboOne, cboTwo and cboThree which used
values related to a table called tblTest which has a fields named field1
(cboOne), field2 (cboTwo), field3 (cboThree) and the information you want to
display in Maintxt.

You could make your relevent selections then have a command button saying
search using the onclick event to execute the code this could be a Dlookup of
the tblTest outputing this to the form text box.

e.g.

Dim varMaintxt As Variant

varMaintxt = DLookup("[Maintxt]", "[tblTest]", "[field1]= '" & Me.
cboOne & _
"'And[field2]=" & Me.cboTwo, & "And[field3]=" & Me.cboThree)

Me.Maintxt = varMaintxt

This isn't literal just an example of finding and displaying there are many
other methods such as queries etc and would depend what information you
wanted to display.

email me an example of the information if your still struggling and will send
you an example back,

good luck John :)
 
J

jsv2002

P.S. mail jsv2002[AT]gmail.com :)
There are several ways to shoe information but this would depend on what is
the resultant information you want to show e.g just a text box with a block
of text or several fields of information depending on selection in the drop
down boxes.

Also would you want the combo boxes to cascade filter? in other words when
you have say selected the management group restrict the second combo box
selection to people within that group?

Any way say you 3 combo boxes named cboOne, cboTwo and cboThree which used
values related to a table called tblTest which has a fields named field1
(cboOne), field2 (cboTwo), field3 (cboThree) and the information you want to
display in Maintxt.

You could make your relevent selections then have a command button saying
search using the onclick event to execute the code this could be a Dlookup of
the tblTest outputing this to the form text box.

e.g.

Dim varMaintxt As Variant

varMaintxt = DLookup("[Maintxt]", "[tblTest]", "[field1]= '" & Me.
cboOne & _
"'And[field2]=" & Me.cboTwo, & "And[field3]=" & Me.cboThree)

Me.Maintxt = varMaintxt

This isn't literal just an example of finding and displaying there are many
other methods such as queries etc and would depend what information you
wanted to display.

email me an example of the information if your still struggling and will send
you an example back,

good luck John :)
I would like to create a form that has drop-down boxes on the top where a
user can choose criteria (i.e. Management Group, Pay Period Start and Pay
[quoted text clipped - 7 lines]
Thanks,
Brooke
 
J

jsv2002 via AccessMonster.com

UPDATE:

Well after seeing the type of Form Brooke wanted e.g. comboBox with a
start/end date to display several fields of information in a datasheet view
suggested a unbound subform with a SQL Select event behind onclick of a
command button;

Private Sub strSearch_Click()
On Error GoTo Err_strSearch_Click


Dim strSQL As String

strSQL = "SELECT * FROM qryInvoiceData WHERE GrpDescription= '" & Me
("strGroup").Value & "' AND InvDate Between #" & strDate & "# And #" &
EndDate & "# "

Me("frmsManagerRpt").Form.RecordSource = strSQL

Exit_strSearch_Click:
Exit Sub

Err_strSearch_Click:
MsgBox "This action cannot be performed at this time" _
& vbCr & vbCr & "Please check your search criteria for errors..
.", vbInformation _
, "Management
Report..."
Resume Exit_strSearch_Click

End Sub

frmsManagerRpt being the unbound subform anyone has some other suggestions
please let us know :)
P.S. mail jsv2002[AT]gmail.com :)
There are several ways to shoe information but this would depend on what is
the resultant information you want to show e.g just a text box with a block
[quoted text clipped - 38 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top