C CFP - Russell Guest Aug 14, 2003 #1 Hello everyone, I would like to use a listbox to open different forms based on the value of a specific field in the listbox.
Hello everyone, I would like to use a listbox to open different forms based on the value of a specific field in the listbox.
Mile-O Back once again... Local time Today, 08:50 Joined Dec 10, 2002 Messages 11,316 Aug 14, 2003 #2 DoCmd.OpenForm "myForm", , , "myID = " & Me.myListBox
C CFP - Russell Guest Aug 14, 2003 #3 Thanks but i have 4 different forms I want the same listbox to be able to open.
M MadMaxx .NET foo Local time Today, 03:50 Joined Jun 27, 2003 Messages 138 Aug 14, 2003 #4 You can still use Mile's code. The only thing you have to do different is specifiy which column you want to compare data to. DoCmd.OpenForm "MyForm",,,"mid =" & Forms!ListForm!lstBox.Column(0) DoCmd.OpenForm "MyForm2",,,"location =" & Forms!ListForm!lstBox.Column(1) And so on..... Hope this helps.
You can still use Mile's code. The only thing you have to do different is specifiy which column you want to compare data to. DoCmd.OpenForm "MyForm",,,"mid =" & Forms!ListForm!lstBox.Column(0) DoCmd.OpenForm "MyForm2",,,"location =" & Forms!ListForm!lstBox.Column(1) And so on..... Hope this helps.
C CFP - Russell Guest Aug 14, 2003 #5 Thanks but I dont need to open more than one form at once. What I need is to have the correct form open based on the value in the listbox. So the form name that opens is going to vary based on the workorder type. The listbox shows all the workorders and If the workorder is a fire suppression workorder I want the fire suppression workorder form to open. I hope this is a little more clear. Thanks, Russell
Thanks but I dont need to open more than one form at once. What I need is to have the correct form open based on the value in the listbox. So the form name that opens is going to vary based on the workorder type. The listbox shows all the workorders and If the workorder is a fire suppression workorder I want the fire suppression workorder form to open. I hope this is a little more clear. Thanks, Russell
M MadMaxx .NET foo Local time Today, 03:50 Joined Jun 27, 2003 Messages 138 Aug 14, 2003 #6 I realize that. Doesn't mean you have to open many forms at once. just use an if statement with the colum reference like before. Set the if statement to check for different values and these values open different forms. Last edited: Aug 14, 2003
I realize that. Doesn't mean you have to open many forms at once. just use an if statement with the colum reference like before. Set the if statement to check for different values and these values open different forms.
R Rich Guest Aug 14, 2003 #7 Your structure sounds suspect, why do have different forms dependant on type?