Button to create a report with selectable filters (1 Viewer)

Jab331

Registered User.
Local time
Today, 10:28
Joined
Sep 25, 2018
Messages
15
Hi everyone,

I need to create a button on a database switchboard to "Tool List Via Customer" so basically i would like to be able to click the button which will then bring up a list of customers with check boxes (doesn't need to be a check box, just a selectable list) so one can be selected which then created a report showing all of their tools and relevant information in the table.

I am pretty much a complete novice so all help is appreciated.

Thanks,

Jack
 

Ranman256

Well-known member
Local time
Today, 05:28
Joined
Apr 9, 2015
Messages
4,337
you can have the customer table have a field : MARK , as y/n
show the list and the MARK field, the user checks the customers wanted.

then the report query would join to the customers table where MARK = TRUE.
then your report will show only those chosen.

an update query may be needed to set all MARK = false, to start fresh.
 

Jab331

Registered User.
Local time
Today, 10:28
Joined
Sep 25, 2018
Messages
15
Thank you for your reply.

I'm really sorry but i wouldn't really know where to start with trying to implement that, prior to this project i have only ever been an end user of access databases, rather than a creator.

Thanks,

Jack
 

GinaWhipp

AWF VIP
Local time
Today, 05:28
Joined
Jun 21, 2011
Messages
5,899
Hmm, well I would suggest a List Box on a Form. Create a multi-select List Box with the list of Customers making sure the first column of the List Box is the Customers Primary Key. Once you do that post the name of the List Box and the field name of the first column of the List Box which is the Primary Key and the name of the Report that you want to display.
 

Jab331

Registered User.
Local time
Today, 10:28
Joined
Sep 25, 2018
Messages
15
Hi Gina,

I have created a list box and entered just a few of the customer names for now just until i have a working model, i have also create an ID field giving each customer a number.

The list box is called "Customer_List", the Report is called "Customer_Report" and the field name is called "ID".

Thanks
 

isladogs

MVP / VIP
Local time
Today, 10:28
Joined
Jan 14, 2017
Messages
18,216
Gina's suggestion is very similar to the listbox & form question you had yesterday. Use a similar approach in this case.

I would strongly recommend you work through some online Access tutorial videos. Those by Steve Bishop & Richard Rost are both very good covering everything from the basics through to advanced concepts.
Time spent doing this now will repay itself many times over in time saved in the future
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:28
Joined
May 7, 2009
Messages
19,234
add a button on the form to do the actual print-out.
add code to it's Click Event:

Private Sub button_Click()
Dim strFilter As Variant
Dim varItem As Variant
strFilter=Null
If Me.Customer_List.ListIndex <> -1 Then
For Each varItem In Me.Customer_List.ItemsSelected
strFillter = (strFilter + ",") & Me.Customer_List.ItemData(varItem)
Next
DoCmd.OpenReport "Customer_Report", acViewPreview,, "ID In (" & strFilter & ")"

Else
Msgbox "You need to select at least a Customer from the List"
End If
End Sub
 

GinaWhipp

AWF VIP
Local time
Today, 05:28
Joined
Jun 21, 2011
Messages
5,899
I see arnelgp posted the next steps. Did that give you what you want?
 

Users who are viewing this thread

Top Bottom