Ok, so for a school project we are creating databases. On mine, I have a form based on a query which has a print report button on it. I want to create a form that prompts the user to click ok/cancel to confirm that they actually wanted to print the report (because more than once I have thought I was in design mode and accidentally printed the report, which I now have a pile of).
However, instead of creating a prompt form for each form that has a print button, I'd like to have one prompt form that, depending on what form the user is currently on, would print a specific report. I tried using a macro to set a temp var, which when you press OK on the prompt form it would check the value, and based on that perform a certain action. However, I'm having trouble with what to do next - the "SetTempVar" command has 2 arguments, name and expression, and I understand that name is the variable name, and expression is what it checks to find the value of the variable, but I don't know how to check the current form name - It says "IIf(<expression>,<truepart>,<falsepart>)"
I'd imagine that I'd put "IIf(<form = form XYZ>, 1, IIf ( <form = form ABC>, 2, .....)) which would continue for each form that I have. There's probably a simpler way to do it but I don't know how to check the current form name and set the variable to that value.
(where <form = whatever> is the actual expression which checks what the form is)
[B]Edit:[/b]
solved my problem, you can use MsgBox("Print Report?",1,"Confirm Action")=1 as a condition for the macro, which will give you a dialog box. Problem 2 still remains though (below)
ALSO: On my query forms, I'd like the title of the form (it's in the form header) to include whatever the user inputs, for example I have a form that checks who has rented a DVD, where the user inputs the name of the DVD. The title is "Rentals for XXX" where XXX would be what the user entered. How do I do this?
Sorry, you need to Log In to post a reply to this thread.