Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Criteria in Access Project

I cannot suss out how to write the following criteria (which I used in .mdb) in an access project :

[Forms]![FormName]![FormFieldName]

Sorry but I am a novice!
0
Prestigeres
Asked:
Prestigeres
  • 4
  • 3
  • 2
2 Solutions
 
Jokra_the_BarbarianCommented:
Need some more information. The example you gave is a perfectly reference in an adp. Are you attempting to use the field for query criteria? Are you referring to an open form?
0
 
PrestigeresAuthor Commented:
As a query criteria... it displays "Data Type Error in expression" when I try to save it :(
0
 
Jokra_the_BarbarianCommented:
Could you please post your code? Thanks.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
leslynfCommented:
1. You need to have a form open when you run the query
2. You need to put the name of your form and the name of your field in place of the words FormName and FormFieldName. For example, if your form name is frmOrders and the field name is strItem, the following would be the criteria:
 [forms]![frmOrders]![strItem]

Hope this helps.

Leslyn:)
0
 
PrestigeresAuthor Commented:
Nope its not having any of it - my code is as follows :

[forms]![Country]![ddCurrency]
(Country being the name of the form and ddCurrency being the name of the combobox on the form)

I just dont get it.... is it anything to do with SQL Server?

Regards
Julie

0
 
Jokra_the_BarbarianCommented:
We still need the code in order to assist you. Could you please post the code for your query?

It might have something to do with the query string and what you are actually reading from the combo box, but I can't tell until I see the code.
0
 
PrestigeresAuthor Commented:
I am sorry you are talking to an absolute thicko.... please show me an example and I will suss it out from there and post the code for you :)
0
 
Jokra_the_BarbarianCommented:
From a different post, you should have some code similar to the following:
 
  strSQL = "UPDATE tblWWMSData SET tblWWMSData.[CONTACT INFORMATION] = [contact information] & Now() & ' ' & CurrentUser() & ': ' & [forms]![frmNotePad]![txtNewNotes] WHERE (((tblWWMSData.ID)=[forms]![frmNotePad]![txtID]));"

You probably have a select statement vs. an update. This is what I need to see in order to assist you. Thanks. -Jokra
0
 
leslynfCommented:
Here is the deal. Your combo box may be showing text; however, the actually item in the combo box is probably the identifying number that is unique to that item that shows. You are trying to match the choice to a field in your query that is text, when the identifier is what you need to match.

Leslyn :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now