473,500 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Queries in Access 2003

I've built a shared database that sits on shared network drive using
Access 2003 (Access 2000 file format). I've also built a simple query
form that uses unbound textbox controls to build the query dynamically.
The results of the query are placed into a subform in datasheet view
on the same query form. This query works just like it's supposed to on
my machine (I'm using Access 2003), but when another user tries to run
the exact same query (using Access 2000) the query form just sits there
and doesn't do a thing. Any suggestions?

I'm somewhat new to this Access programming thing.

My code looks like this:
Public Sub cmdSearch_Click()
Dim rs As Recordset

Dim strSQL As Variant
Dim strSelect As Variant
Dim varWhere As Variant

varWhere = Null

'select the table based on checkbox
If Me.chkHistory = True Then
strSelect = "SELECT * FROM ProjListHist WHERE "
Else
strSelect = "SELECT * FROM ProjList WHERE "
End If

'select whether escalated or not
If chkEscalated = True Then
varWhere = (varWhere + " AND ") & " EscStatus = 'Escalated'"
End If

'build string Release Month
If Not IsNothing(Me.txtRelMonth) Then
varWhere = (varWhere + " AND ") & " RelMonth = '" &
Me.txtRelMonth & "'"
End If

'build string Budget Subtype
If Not IsNothing(Me.txtBudgetST) Then
varWhere = (varWhere + " AND ") & " BudgetST = '" &
Me.txtBudgetST & "'"
End If

'build string SPMID
If Not IsNothing(Me.txtSPMID) Then
varWhere = (varWhere + " AND ") & " SPMID = '" & Me.txtSPMID &
"'"
End If

'build string Initiative number
If Not IsNothing(Me.txtInitNum) Then
varWhere = (varWhere + " AND ") & " InitNum = '" &
Me.txtInitNum & "'"
End If

'build string Add date
If Not IsNothing(Me.txtAddDt) Then
varWhere = (varWhere + " AND ") & " addDt = #" & Me.txtAddDt &
"#"
End If

'build string Front door manager
If Not IsNothing(Me.txtFrntDrMgr) Then
varWhere = (varWhere + " AND ") & " FrntDrProj LIKE '*" &
Me.txtFrntDrMgr & "*'"
End If

'build original pc release month
If Not IsNothing(Me.txtOrigPCRelMonth) Then
varWhere = (varWhere + " AND ") & " OrigPCRelMonth = '" &
Me.txtOrigPCRelMonth & "'"
End If

'build curr/esc release month
If Not IsNothing(Me.txtCurrEscRelMonth) Then
varWhere = (varWhere + " AND ") & " CurrEscRelMonth = '" &
Me.txtCurrEscRelMonth & "'"
End If

'build target date
If Not IsNothing(Me.txtTargetDt) Then
varWhere = (varWhere + " AND ") & " TargetedDt = #" &
Me.txtTargetDt & "#"
End If

'build accepted into pmo process date
If Not IsNothing(Me.txtAcceptIntoPMOProcessDt) Then
varWhere = (varWhere + " AND ") & " AcceptIntoPMOProcessDt = #"
& Me.txtAcceptIntoPMOProcessDt & "#"
End If

strSQL = strSelect & varWhere
Set rs = dbs.OpenRecordset(strSQL, dbOpenSnapshot)

Me![frmQueryArea].Form.RecordSource = strSQL
Me![frmQueryArea].Requery

End Sub

Nov 13 '05 #1
1 1589
Hello Paul,

You can remove the code having to do with the recordset rs you declared
(i.e., the 'dim rs...' and 'set rs...' statements) because it's not
being used anywhere and it is not necessary in order to make your query
work. Also, you don't need to set varWhere = Null. On the other hand,
these should not prevent your code from running.

Check to see that both machines are up to date with respect to service
packs for both the OS and for Access/Office.

If possible, I would step through your code on the machine where it is
not working by setting a breakpoint at the end of your code (line
'Me![frmQueryArea].Form.RecordS*ource = strSQL') by clicking somewhere
in the line and pressing F9 key. Then run the form, fill out all the
fields, and click your command button. When the code execution stops
at that line press Ctrl G to bring up the 'immediate window', then type
'?strSQL' (minus quotes of course) and press enter to display the value
of strSQL. You can then copy and paste the value of strSQL into the
SQL window of a new query and see if it brings up anything in datasheet
view (i.e. see if it is a valid query).

HTH,
Bruce

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2323
by: Marco Alting | last post by:
Hi, I'm still confused about my queries, I want to do something is ASP that is easily done in Access. I'll post the Access queries below as a reference. The main idea is that the queries depend...
6
6749
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
4
2000
by: dschl | last post by:
Hi, I'm converting an Access 2000 database to Sql Server and must be missing something obvious. Using the Import utility in Sql Server, the Access queries seem to get executed and the...
6
2104
by: Brad | last post by:
I have an sql query that has specific criteria (like state='PA' or state = 'NJ'...) and would like to be able to have the user specify the criteria dynamically either through the web or from...
4
3541
by: John Smith | last post by:
Isn't life a bitch! You know what you want but you don't know how to get it. I have produced 12 queries that calculate a payment profile over 12 months. For a number of the records (ie with...
5
4003
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
3
4155
by: Kevin Forbes | last post by:
So, I've found how to list all the tables in an Access database (as seen below) and running MS Access queries is easy (similar to executing a stored procedure), but how do I list the names of all...
6
2472
by: falbrech_www | last post by:
Hi all, we got here one database which has several linked tables, whereas the link points to several csv-files. Currently we also have 2 different queries using the linked tables. Now one of us...
3
2539
prn
by: prn | last post by:
Hi folks, I'm trying to create letters based on an Access database. I'm using Access 2003 and Word 2003. Most of the data tables are actually on a SQL server and Access is the front end for them....
1
1558
by: ATS | last post by:
Hi, I, and some collegues of mine, are running into a weird problem with Access 2003. If I want to define a new query (or want to add a table or query to an existing query), Access shows a...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
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,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
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...
0
5490
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,...
1
4923
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...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.