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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Direct SQL Vs Access SQL

Status
Not open for further replies.

JavaToPerlNowVB

Programmer
Joined
Jul 14, 2005
Messages
84
Location
US
I have this query in access, where it takes some information from the form to complete its task
Code:
UPDATE GISADM_GNDLINEFACILITYMAINTPOLE SET GISADM_GNDLINEFACILITYMAINTPOLE.WO = [Forms]![MainSearchForm]![New_WorkOrder_Text]
WHERE (((GISADM_GNDLINEFACILITYMAINTPOLE.WO)=[Forms]![MainSearchForm]![WorkOrder_Text]) AND ((GISADM_GNDLINEFACILITYMAINTPOLE.PREFIX)=[Forms]![MainSearchForm]![Prefix_Text]) AND ((GISADM_GNDLINEFACILITYMAINTPOLE.SUFFIX)=[Forms]![MainSearchForm]![Suffix_Text]));
when it enter the date to the form that get feeded to the query and click update it doesn't do anything.

But when I do same update statement in direct sql like this..
Code:
update gisadm.gndlinefacilitymaintpole set wo='1049031' where wo='1049037' and prefix='105110' and suffix='31';
It works fine where it get update only the date that i want to update.

Please helpout with this, thanks
 
Try adding the form references to the Parameters list for the query and defining them as text.
 
Sorry, I am not sure what you are saying. Can you explain it more. Thanks
 
When you are looking at the query in design view use Query>Paramters from the menu

Add each form reference to the list and specify a text datatype.

I am not saying this will solve the problem for sure but I'm guessing that Access might have an issue with you entering numeric parameters which you want to compare with text fields.
 
My form references didn't showup in the parameter window so I manually typed it, and when i run the program it pops up a window to enter those pareameter values. thanks
 
It should take the values from the form if you have typed the references accurately.
 
i have a field calles "WO", so should give like this
Code:
gisdm_gndlinefacilitymaintpole.WO
gisadm_gndlinefacilitymiantpole is the table name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top