Solved

Criteria in Access Project

Posted on 2004-10-11
9
189 Views
Last Modified: 2010-05-18
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
Comment
Question by:Prestigeres
  • 4
  • 3
  • 2
9 Comments
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 12276392
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
 

Author Comment

by:Prestigeres
ID: 12276797
As a query criteria... it displays "Data Type Error in expression" when I try to save it :(
0
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 12277308
Could you please post your code? Thanks.
0
 
LVL 4

Expert Comment

by:leslynf
ID: 12279610
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Prestigeres
ID: 12285832
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
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 12288342
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
 

Author Comment

by:Prestigeres
ID: 12288558
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
 
LVL 11

Assisted Solution

by:Jokra_the_Barbarian
Jokra_the_Barbarian earned 75 total points
ID: 12288741
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
 
LVL 4

Accepted Solution

by:
leslynf earned 75 total points
ID: 12289744
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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now