Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code not working at a different site

Status
Not open for further replies.

pingit

MIS
Nov 24, 2003
37
0
0
NZ
Hello All

I had a query
strSQL = "SELECT Staff.StaffID, Staff.Lname, Staff.Fname, Staff.Address FROM Staff WHERE Staff.StaffID = " & forms![Setup]![Combo5]
that was causing the error "No given value for one or more of the required parameters" this was fixed by changing the query to
strSQL = "SELECT Staff.StaffID, Staff.Lname, Staff.Fname, Staff.Address FROM Staff WHERE Staff.StaffID = forms![Setup]![Combo5];" see thread thread705-1366808.
The problem is when the corrected database was used at another site the same error has come up. How do I configure access to accept the working sql string? I cannot make adjustments to the database and then test because the adjustments may not work at the other end. thanks in advance
 
I the link you posted, the strings are the other way round. Can you please confirm which SQL string you are currently using?
 
Oops, yep your correct the top code does work on my version of access but not the other. From one of the posts could it be something to do with the "Alpha values" I do not know what this means
 
Alpha values is another way of asking is StaffID is a text field; if it is, you need single quotes. However, I do not think that this is the problem unless you have two different databases or two different back-ends. Did you simply copy the working version to a second PC? Is it a front-end?
 
Yes it is a straight copy. Both have the same version 03 of access
 
Sorry to belabour the point, but is it possble that the older version with the incorrect string was copied to the second PC?
 
Nah the working copy from my PC was emptied of data and then copied across. Just a thought is it possible there are some VBA plugins missing on the other installation of Access? your thoughts
 
Perhaps it's not your SELECT statement that is the problem.

Is the form called "Setup" always open when you run this?

Does Combo5 have a valid value or is it Null (you could test this in the Immediate window when the error occurs)?

 
Are you using a FE and BE or is it all lumped together. If you are using a FE and BE then what operating system are the databases running on.

Life's a journey enjoy the ride...

jazzz
 
It looks like your query is designed to only return one record.

If this is the case, couldn't you use DLookup or rs.FindFirst instead?

Doesn't answer your question but, hey, if it works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top