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

code building...

how do i build up the code if this are the following commands i would want to execute.

i have a few drop down lists. when i select any of the drop down, n click on OK, it should open up a query. the query has a criteria of eg.[forms]![fil_records]![noc_date].

I wanted to build up a code such that when the users click onto OK, if the 1st dropdown is not selected it will go on to the next one, or else if it has been selected, it will open up the query associated. However, there shouldn't be any window appearing to ask for the parameter value for the queries. It should be associated with the drop down such that the value selected will be the parameter value for the query.
May 15 '07 #1
3 1275
Rabbit
12,516 Expert Mod 8TB
I'm not sure I understand completely, you just want to open up a query depending on the first non-null combo box?

Just use an If/Then/ElseIf Not IsNull() structure.
May 17 '07 #2
puppydogbuddy
1,923 Expert 1GB
Here is example of code building for a where clause used to filter a report.
Expand|Select|Wrap|Line Numbers
  1. strFilter = ""
  2. If Not IsNull(Me!combo1) Then strFilter = strFilter & "[fld1]=" & Chr(34) & Me!combo1 & Chr(34) & " AND "
  3. If Not IsNull(Me!combo2) Then strFilter = strFilter & "[fld2]=" & Chr(34) & Me!combo2 & Chr(34) & " AND "
  4. If Not IsNull(Me!combo3) Then strFilter = strFilter & "[fld3]=" & Chr(34) & Me!combo3 & Chr(34) & " AND "
  5.  
  6. If strFilter <> "" Then
  7.     strFilter = Left$(strFilter, Len(strFilter) - 5)
  8.     Me.Filter = strFilter
  9.     Me.FilterOn = True
  10.  
  11.     Me.Requery
  12.     DoCmd.OpenReport strReport, acViewPreview, , strFilter
  13.  
  14. End If
  15.  
Jun 2 '07 #3
JConsulting
603 Expert 512MB
how do i build up the code if this are the following commands i would want to execute.

i have a few drop down lists. when i select any of the drop down, n click on OK, it should open up a query. the query has a criteria of eg.[forms]![fil_records]![noc_date].

I wanted to build up a code such that when the users click onto OK, if the 1st dropdown is not selected it will go on to the next one, or else if it has been selected, it will open up the query associated. However, there shouldn't be any window appearing to ask for the parameter value for the queries. It should be associated with the drop down such that the value selected will be the parameter value for the query.

if it's in the field criteria in your query use this format

iif(nz([forms]![fil_records]![noc_date],0)=0,[noc_date],[forms]![fil_records]![noc_date])

J
Jun 2 '07 #4

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

Similar topics

0
by: PatchFactory Support | last post by:
Description: Professional and easy-to-use patch building environment that can help you to create instant patch packages for software and file updating. Generated patch packages are small size...
9
by: Jenta | last post by:
A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals... ...and Online Registration is now available if you plan to table...
3
by: DrSarang | last post by:
While building XmlSampleGenerator code from MSDN, I get missing XmlSchemaSet reference. Here is the screen dump, if needed. C:\Documents and Settings\Dr Sarang\My Documents\MSDN\XML Sample...
1
by: Corey | last post by:
I have a form bound to a query with several thousand records in it. I want to be able to have a combo box that lists 4 or 5 of the query fields and an unbound textbox that i can supply data then...
2
by: Gawel | last post by:
Hajo, I have soulutin with 7 library projects and 2 web projects. When I change something in one of the libraries and hit F5 it takes literally 1-2 minutes to start an application. I've...
1
by: rdemyan via AccessMonster.com | last post by:
My application has a table that contains information on buildings. The building data comes from another database and is imported from a spreadsheet into my application. Originally, I thought...
7
by: digimotif | last post by:
All, I'm currently working with a small development company on a PHP application they already have. There are several processing tasks that could be scripted in Python and run in the background...
7
by: David Delony | last post by:
Since the best way to learn how to program well is to read other people's programs, which open source projects written in C stand out as examples of well-written code? -- There's no place...
13
by: Ramon F Herrera | last post by:
I am writing a program that generates source code. See a snippet below. My question is about the use of that growing 'code' variable. Is it efficient? Is is recommended for this case? The code...
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.