Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 20-12-2008
Member
 
Join Date: Nov 2008
Posts: 1,221
Help in Access query

From an Access form, is it possible to send the contents of a text box as a variable in a query? If so, this is it with the code or should I directly put some criteria into the query?
Reply With Quote
  #2  
Old 20-12-2008
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Help in Access query

It is quite possible to save the contents of a text box as a criterion in a SQL query.

Example: UPDATE req SET num_req = '" & txtNum & "' where id_req = " & txtId

Here of course, txtid and txtnom are text box.
Reply With Quote
  #3  
Old 20-12-2008
Member
 
Join Date: Feb 2008
Posts: 194
Re: Help in Access query

Here is the syntax:

Code:
[forms]![NumForm]![NumField]
Forms is a Keyword Access to write unchanged.
NumForm: refers to the collection of forms
Reply With Quote
  #4  
Old 20-12-2008
Member
 
Join Date: Nov 2008
Posts: 1,221
Re: Help in Access query

Let's say I use a text box and the name of the text box is "Text19", I added to test

[forms] [SearchContacts1] [Text19]

but this always asks me to add the value even though my text box is not empty.

Can anyone help me please?
Reply With Quote
  #5  
Old 20-12-2008
Member
 
Join Date: Feb 2008
Posts: 194
Re: Help in Access query

What is your "Where" clause?

Normally, it should be like: Like "*" & [form] [SearchContacts1] [Text19] & "*"
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Help in Access query"
Thread Thread Starter Forum Replies Last Post
Pass query in design mode in Access 2007 Chandranath Windows Software 5 08-01-2010 06:45 AM
Create batch file to run access query DeMario Software Development 5 31-12-2009 04:44 AM
How to run Query Automatically on MS Access Rixwel Software Development 3 18-08-2009 10:24 AM
Limit Rows Returned In Access Query NetWorm Software Development 4 25-02-2009 10:32 PM
Excel function calculations used in MS Access query akbar MS Office Support 1 23-05-2008 08:52 PM


All times are GMT +5.5. The time now is 12:54 AM.