Solved Function to select which form to open

Seph

Member
Local time
Today, 18:32
Joined
Jul 12, 2022
Messages
72
Good day everyone,

Does anyone know any way (VBA or Function) to select a "option" and then based on that selection open a desired form.

Example:

1666769454161.png

Thanks!
 
I would have thought the forms for a sales invoice and job invoice would be the same, but simply with an Invoice type field?
 
I would have thought the forms for a sales invoice and job invoice would be the same, but simply with an Invoice type field?
Thanks for your response.

Job invoices pull values from tables whereas Sales Invoices capture new invoice related data directly to the Invoice table
 
would have thought a simple if statement would do it

Code:
if option=1 then
   open this form
else
   open that form
end if


or a case statement

Code:
select case option
   case 1
      open this form
    case 2
      open that form
end select

edit: - not sure why you had it but I have removed your duplicate post
 
Yes, a simple If statement in your example would do that.
If you have more than that, then perhaps a Case statement, or even a table to identify which form. Less code then and easier to amend/update.
 
would have thought a simple if statement would do it

Code:
if option=1 then
   open this form
else
   open that form
end if


or a case statement

Code:
select case option
   case 1
      open this form
    case 2
      open that form
end select

edit: - not sure why you had it but I have removed your duplicate post
That's perfect thank you!

Sorry must of misclicked.
 
Yes, a simple If statement in your example would do that.
If you have more than that, then perhaps a Case statement, or even a table to identify which form. Less code then and easier to amend/update.
Thank you for your input.
 

Users who are viewing this thread

Back
Top Bottom