Discussion Locked

How to create a pop-up dialog box ?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How can you create a pop-up dialog box appeared when clicking on a Report, asking for Status which can tell a query to select certain data for the Report?

I have a Transaction table which contains all data inputed from a Form (DataEntry), a query(PPR) and a Report (ReportByStatus). In the Trasaction table, there is a Status field which has "Open, Rejected, RFT..". I want to create an automatic dialog box asking for entering status when I click to open the ReportByStatus. If I don't enteranything in the dialog box, the Report will show all data.

Thank you,
Alan.

5 replies

by roc180

Use the Inputbox function. The following code should accomplish what you want.

Private Sub CmdOpenRpt_Click()
Dim strAns as string

strAns = InputBox("Enter Status", _
"This is my title", "Default value=1")

If strAns="" then 'Nodata entered or Cancel

Else
'Build Query for Report, using
'Parameter strAns

Docmd.OpenReport "Rpt"
End if

End Sub

If you need any more help let me know.

Good Luck

Neal Martinelli

by kbrown

You can also create a pop-up dialog for criteria very easily in the query's design view. In one of the criteria boxes enter your question surrounded by brackets.

Example: [Enter Status (Open, Rejected, RFT ...):]

This is very quick and easy and will pop up with queries, reports or forms.

This discussion is closed to new replies.