473,396 Members | 2,036 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,396 software developers and data experts.

Search Form Code

f430
43
hi, i have a master table with all my part information, and it has columns with part number, date, defects,...
and i am trying to write a code for my search form.
i have created a search form on Access, and it has 5 combo boxes for:
part number
defects
assembled by
and the other 2 combo boxes are for "from" and "to" date range. i have made the combo boxes for the date range to display a calendar when clicked and choose a date.

i have been trying to write a code that only requires one of these fields to be filled out and it can filter my master table.
i would appreciate any help on this
Thanks
Aug 9 '10
61 3679
NeoPa
32,556 Expert Mod 16PB
You are talking as if you don't know the difference between VBA code and SQL code.

Earlier, we were talking about VBA code. We created a SQL filter string within this VBA to apply to the RecordSource of the form. The RecordSource would basically be a SQL string. The event procedures we've been working in though, would be VBA.
Aug 16 '10 #51
f430
43
i have been trying to manipulate the vba code into my search query but im running into a lot of problems.
i know that all i need to have are lines # 2, 6, 12, 17 from post #20
but i cant seem to have the right sql for it.
i was wondering if u had an example or anything that might help.

Thanks
Aug 17 '10 #52
NeoPa
32,556 Expert Mod 16PB
I get the feeling you're not paying attention to what I post again. You keep coming back at me with stuff that makes no sense. I am trying to clarify things by asking important questions, designed to help me understand what you're talking about. If you ignore this and try to explain again in the same way as before we will get nowhere (Obviously. If I could understand you explaining it that way, there would be no need for the clever questions in the first place).

Either respond to my posts or I cannot help you. I can only help you to a certain extent to say what you need in a way that makes sense. If you ignore me then I can't help at all, and if I don't know what you're talking about I can't help technically either.

It's quite simple really.
Aug 18 '10 #53
f430
43
im not sure what questions i exactly missed, but i'll try to explain what i am having difficulty with.
for example if i take this code below:
Expand|Select|Wrap|Line Numbers
  1. If Not IsNull(Me.Defect) Then _
  2.        strFilter = strFilter & " AND " & "('" & Me.Defect & "' In([Defect Code 1]," & "[Defect Code 2]," & "[Defect Code 3]))"
how can i make this code in sql language?
i have been trying to put it in the "select, where" format, but it doesn't seem to be correct
Aug 18 '10 #54
f430
43
one more question, what is the purpose of having this search query when i have the vba code for my search form. would i be able to make my search form function without the query
Aug 19 '10 #55
NeoPa
32,556 Expert Mod 16PB
It seems to me you're still confused over the difference between SQL and VBA, but you ignored my post where I attempted to clarify this with you then simple carried on regardless.

Frankly, I find the first problem needs very careful handling, which is entirely impossible unless I have your full attention. Simply ignoring it and hoping it will go away is not going to make for good (any) progress. Trying to proceed from that point is unwise in the extreme. To illustrate, it's like finding someone to ask for help, and when you find they only speak Eskimo, going on to ask them to explain Einstein's Special Theory of Relativity. It matters nothing how important it is for you to understand it. You will not understand what they say anyway, and they have no idea what you're asking.
Aug 24 '10 #56
F430, are you using the program Access by Microsoft or are you using SQL by Microsoft or perhaps you are in Visual Basic Studio or VB.net? Which one are you using, because the code is fundamentally different for each!
IE... Code for running a SQL Statement in SQL is different than running the same code in Access(VBA).

So, Which program are you using? (Is this a good question NeoPa?)
Aug 24 '10 #57
NeoPa
32,556 Expert Mod 16PB
Michael Adams:
(Is this a good question NeoPa?)
It seems valid. Fundamentally, anything which can help communication is good. Communication in this thread is pretty poor overall. That is not to say anyone is being lazy or not trying, as some people just don't have good instincts or skills in that direction. Anything that can help members to understand the critical nature of clear communication, and how much depends on that, is a good thing in my book.

PS. From what's been posted already I'm fairly sure Access is the application involved. There seems to be some confusion over how SQL & VBA fit into the whole picture, but I'm confident that's where the issues lie.
Aug 25 '10 #58
Just for a side note then, When he is coding a SQL statement does it need to start like?
Expand|Select|Wrap|Line Numbers
  1. ssql
Aug 26 '10 #59
NeoPa
32,556 Expert Mod 16PB
No Michael (unless I misunderstand you completely, which is possible as I don't know where you're coming from with this).

SQL statements are usually resolved first as VBA strings, and are then passed to the SQL interpreter in one of a whole bundle of ways.

The most common form of SQL would be a simple SELECT statement of the form :
Expand|Select|Wrap|Line Numbers
  1. SELECT   [X]
  2.        , [Y]
  3.        , ...
  4. FROM     [Table]
  5. WHERE    ...
  6. ORDER BY ...
Aug 26 '10 #60
I ment in VBA. The code that I have used starts with ssql then the SELECT...
Aug 26 '10 #61
NeoPa
32,556 Expert Mod 16PB
I can only guess you have a string variable declared as sSQL Michael. In that case yes of course, but there's no way I can know what you use as variable names without your telling me ;)
Aug 26 '10 #62

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

Similar topics

7
by: jim Bob | last post by:
Hi, This is probably very simple to do so if anyone can point me to the right place for reading, it would be much appreciated. I just want to build a very basic search form where i can enter a...
3
by: Sheau Wei | last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code? Thanks <Table cellspacing=1 cellPadding=1...
31
by: DWolff | last post by:
I'm somewhat new to Access, and have no VB experience at all (except for modifying existing code where obvious). I built a data entry form that works fine. Typically, a client will call in and...
9
by: lightning | last post by:
Hi all, I'm not very conversant with the vocabulary of Access, so please ask for clarification if necessary... I am trying to build a search form that allows combinations of search terms. For...
6
by: KiwiGenie | last post by:
Hi..I am trying to make a search form. I am fairly new to access and could well be looking at it completely wrong. I have an unbound form with textboxes in the header for entering different search...
2
by: Mark | last post by:
Hi All, I am creating a music database for a friend and have run into a problem. Within the ALBUM table, I wanted to store the ARTIST_ID rather than the ARTIST_NAME. To do this, I intended to have...
2
by: woodey2002 | last post by:
Hi Guys and thanks for your time. I have a search form for my database that allows users to select multiple criteria from multi select list boxes. I successfully integrated a multi select...
6
by: woodey2002 | last post by:
Hi Everyone. Thanks for your time. I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
6
by: mercout | last post by:
Hey, I've been trying to create a search form in access for a while now, searching through books and emails. I have the search form set up with 11 combo box's, 3 text box's, a view button, and a...
8
by: munkee | last post by:
Hi everyone, I am using the following code adapted from Allen Browne: 'Purpose: This module illustrates how to create a search form, _ where the user can enter as many or few...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.