- Private Sub Submit_Button_Click()
-
If IsNull(Me.Type_Text) Or Me.Type_Text = "" Then
-
MsgBox "Please select criteria for Report Type.", vbExclamation, "Attention"
-
Else
-
If Me.Type_Text = "Requisitions" Then
-
DoCmd.OpenForm "Date Form"
-
Else
-
If [Forms]![Report Form]![Equipment Combo] = "" Then
-
DoCmd.OpenReport "Equipment Inventory Report", acViewPreview
-
End If
-
End If
-
End If
-
End Sub
-
4 1209
so in the combo box I have the options "requisitions" and "inventory". the submit button works for the requisitions option and opens the date form, but it does not perform the action and go to the "equipment inventory report" when i click on "inventory
Is [Equipment Combo] blank?
You might want to put something like the following to see if it is falling through your code without doing anything: - Private Sub Submit_Button_Click()
-
If IsNull(Me.Type_Text) Or Me.Type_Text = "" Then
-
MsgBox "Please select criteria for Report Type.", vbExclamation, "Attention"
-
Else
-
If Me.Type_Text = "Requisitions" Then
-
DoCmd.OpenForm "Date Form"
-
Else
-
If [Forms]![Report Form]![Equipment Combo] = "" Then
-
DoCmd.OpenReport "Equipment Inventory Report", acViewPreview
-
Else -
MsgBox "Please fill provide the Equipment Something.", vbExclamation, "Attention" -
End If
-
End If
-
End If
-
End Sub
-
I added that code and when I clicked the "submit button, that msgBox did pop up. How do I fix it so that it will link the equipment in the box. I am selecting a piece of equipment in the previous form and its working for the "requisitions" option of the combo box, but not the 'inventory"
I'm not really sure what you are attempting to do, so this is my best guess. My guess is that the test for an [Equipment Combo] selection is backwards, so I would swap the sign (or swap the code).
Swapping Sign: - Private Sub Submit_Button_Click()
-
If IsNull(Me.Type_Text) Or Me.Type_Text = "" Then
-
MsgBox "Please select criteria for Report Type.", vbExclamation, "Attention"
-
Else
-
If Me.Type_Text = "Requisitions" Then
-
DoCmd.OpenForm "Date Form"
-
Else
-
If Nz([Forms]![Report Form]![Equipment Combo], "") <> "" Then
-
DoCmd.OpenReport "Equipment Inventory Report", acViewPreview
-
Else
-
MsgBox "Please fill provide the Equipment Something.", vbExclamation, "Attention"
-
End If
-
End If
-
End If
-
End Sub
Or, Swapping Code: - Private Sub Submit_Button_Click()
-
If IsNull(Me.Type_Text) Or Me.Type_Text = "" Then
-
MsgBox "Please select criteria for Report Type.", vbExclamation, "Attention"
-
Else
-
If Me.Type_Text = "Requisitions" Then
-
DoCmd.OpenForm "Date Form"
-
Else
-
If [Forms]![Report Form]![Equipment Combo] = "" Then
-
MsgBox "Please fill provide the Equipment Something.", vbExclamation, "Attention"
-
Else
-
DoCmd.OpenReport "Equipment Inventory Report", acViewPreview
-
End If
-
End If
-
End If
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ryan |
last post by:
I currently have two image submit buttons. The code generated looks like
so:
<input type="image" src="button_in_cart.gif" border="0" alt="Add"
title="Add" name="btn_cart" value="buy">
<input...
|
by: Matt |
last post by:
The ASP page has a combo box with id list, and when user click the
particular id, it will show the name in the text box. My attempt was when
the user have event on combo box, it will call...
|
by: Matt |
last post by:
I want to understand the difference between submit button and regular
button: <input type="submit"> and <input type="button">. My understanding is
that submit button will send the entire HTML form...
|
by: a10392 |
last post by:
Hi,
I'am triyng to create a form where i have 2 comboBox and 2 textbox, when the selection changes on the first combo , the content of second also changes. i have to use onchange=form.submit()
...
|
by: bbcrock |
last post by:
I created a "cancel" button for my form at the clients' request, I
accidentally copied a submit button and added an OnClick event- a very
simple javascript.history function. It did not appear to...
|
by: Dmitry Korolyov [MVP] |
last post by:
When we use
btnSubmit.Attributes = "javascript: this.disabled=true;"
to make the button disabled and prevent users from clicking it again while
form data still posting, there is no longer...
|
by: Alex |
last post by:
Hello,
I hope I can explain this properly. I'm writing an application with a
tabbed-based navigation, and a form which gets filled out by users will
be split into 5 subtabs. What I need is...
|
by: sschmidt460 |
last post by:
Private Sub Submit_Button_Click()
If IsNull(Me.Type_Text) Or Me.Type_Text = "" Then
MsgBox "Please select criteria for Report Type.", vbExclamation, "Attention"
Else
If Me.Type_Text =...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |