473,217 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,217 software developers and data experts.

Using checkboxes with a search box

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnSearch_Click()
  2.     Dim SQL As String
  3.     Dim Avionics As Integer
  4.     Dim Powerplant As Integer
  5.     Dim Shops As Integer
  6.     Dim Structures As Integer
  7.     Dim Systems As Integer
  8.  
  9. If IsNull(Me.txtOrderSearch) Or Me.txtOrderSearch = "" Then
  10.     MsgBox "Please Type in your search keyword.", vbOKOnly, "Keyword Needed"
  11. Else
  12.     If Me.chkAvionics = True Then
  13.         Avionics = 1
  14.     End If
  15.     If Me.chkPowerplant = True Then
  16.         Powerplant = 2
  17.     End If
  18.     If Me.chkShops = True Then
  19.         Shops = 3
  20.     If Me.chkStructures = True Then
  21.         Structures = 4
  22.     If Me.chkSystems = True Then
  23.         Systems = 5
  24.     End If
  25.  
  26.     SQL = "SELECT Overdue_Order_Responses_Archive.RO_MPN, Overdue_Order_Responses_Archive.RO_SERIAL_NR, Overdue_Order_Responses_Archive.[Vendor Name], Overdue_Order_Responses_Archive.[Commodity Final], Overdue_Order_Responses_Archive.[Estimated Ship Date (Date Only MM/DD/YYYY)], Overdue_Order_Responses_Archive.Comments, Overdue_Order_Responses_Archive.[Date Added], Overdue_Order_Responses_Archive.RO_NR " _
  27.         & "FROM Overdue_Order_Responses_Archive " _
  28.         & "WHERE [RO_MPN] = '" & Me.txtOrderSearch & "' " _
  29.         & " OR [Comments] LIKE '*" & Me.txtOrderSearch & "*' " _
  30.         & " OR [Commodity Final] = " & Avionics & "" _
  31.         & " OR [Commodity Final] = " & Powerplant & "" _
  32.         & " OR [Commodity Final] = " & Shops & "" _
  33.         & " OR [Commodity Final] = " & Structures & "" _
  34.         & " OR [Commodity Final] = " & Systems & "" _
  35.         & "ORDER BY Overdue_Order_Responses_Archive.RO_SERIAL_NR DESC , Overdue_Order_Responses_Archive.[Date Added] DESC "
  36.  
  37.     Me.subRptAnalysis.Report.RecordSource = SQL
  38.     Me.subRptAnalysis.Report.Requery
  39.  
  40. End If
  41. End Sub
  42.  

Above is my code, but I keep getting the error "Compile error: Block If without End If" Please help
Nov 16 '21 #1

✓ answered by SioSio

Two "End IF" statements are missing for the "IF" statement. What is missing seems to be the "End If" for the "IF" on lines 18 and 20.

1 8691
SioSio
272 256MB
Two "End IF" statements are missing for the "IF" statement. What is missing seems to be the "End If" for the "IF" on lines 18 and 20.
Nov 18 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
2
by: N. | last post by:
Insertion sort is O(N^2), but I figure I can get it in to O(N log2 N) if the inside loop of the insertion sort is replaced with a binary search. However, I'm having some implimentation problems......
0
by: Stanley Sinclair | last post by:
I have a table in V8.1.2 (Windows) which contains about 17,000 constant rows. One column contains a string of about 20 English words. I need to find all rows which contain three words specified...
5
by: Deborah V. Gardner | last post by:
I would like to use "Yes" and "No" checkboxes on a subform. The problem is that when I click the Yes checkbox on the subform, all of the checkboxes are checked. Currently, I have a field...
3
by: Mark | last post by:
I am looking for an example of using checkboxes in a repeater control where the checkbox state is persisted from page to page. Thank you, Mark
5
by: sianan | last post by:
I have an ASP.NET custom control, which contains a DataGrid with checkboxes. I am trying to figure out how to retrieve the selected records, based on the checkbox's checked state. I want to send...
0
by: shameem | last post by:
hi 2 all, my question is how to delete the records by using checkboxes in datagrid. pls give reply to my question.
3
by: mountain.dog | last post by:
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute"...
1
by: Mike Massaro | last post by:
Hello everyone, I'm working on adding checkboxes to the edit_profile section where members should be able choose with checkboxes the multiple options of massage techniques offered... When I...
4
by: mesairv | last post by:
Hi everyone. Im new here. I had been reading several topics in line with filtering, but i cannot find one related to my concern. Please help me to create a command button that will filter my...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.