473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to populate a form text box using a query

14
Hi,

I am trying to populate a form textbox1 using a sql query. The query takes the "where" parameters from another textbox2 located on the form. Please see the syntax below.

When i try to run the query, the textbox1 does not display the result, but instead shows the select statement. Am i doing something wrong? please help.


Expand|Select|Wrap|Line Numbers
  1. Me!QuoteDetailsSubform.Form![ProductDescription] = "SELECT tblProductPrice.[ProdutDescription] FROM tblProductPrice WHERE tblProductPrice.[ProdutNumber] = Me!QuoteDetailsSubform.Form![Product Number]"
Jun 14 '07 #1
3 11227
BradHodge
166 Expert 100+
I had this same problem recently and mmccarthy helped me out. Take a look at this link...

http://www.thescripts.com/forum/thread646354.html

Hope this helps,

Brad.
Jun 14 '07 #2
BradHodge
166 Expert 100+
Might I also say that NeoPa had quite a bit of helpful advice on this one too :)!
Jun 14 '07 #3
NeoPa
32,556 Expert Mod 16PB
Hi,

I am trying to populate a form textbox1 using a sql query. The query takes the "where" parameters from another textbox2 located on the form. Please see the syntax below.

When i try to run the query, the textbox1 does not display the result, but instead shows the select statement. Am I doing something wrong? please help.


Expand|Select|Wrap|Line Numbers
  1. Me!QuoteDetailsSubform.Form![ProductDescription] = "SELECT tblProductPrice.[ProdutDescription] FROM tblProductPrice WHERE tblProductPrice.[ProdutNumber] = Me!QuoteDetailsSubform.Form![Product Number]"
Yes you are I'm afraid. Assigning a SQL string to a TextBox will do just that (as you've seen). It won't resolve that SQL for you. You probably want to use something like DLookup().
Jun 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
3
by: Damian | last post by:
Hi. Is there a way to programatically populate a continuous form? I have an array of descriptions that I want to display in the continuous form and I have a textbox on the form called...
4
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be...
1
by: Yodel99 | last post by:
Greetings, I have a form (Form1) based on a parameter query (Query1). I want the value that the user enters in the parameter window to populate a field in the form. I've been able to use the...
5
by: chrisse_2 | last post by:
Hi, I need some help. I have created a form where there are 3 combo boxes and a text box to search through records. Based on what the user fills in, you then it a "go" button to run the query...
4
by: Jimmy | last post by:
I have a form with a command button on it that is supposed to open up a report and use a query to populate it. DoCmd.OpenReport "rptMailingList", acViewPreview, "qryMailingListChristmas" ...
3
by: David | last post by:
I am trying to use Dlookup to populate a text box on a form, but haven't had any good luck so far. I've looked here at the posts and have used the Access help for examples. Northwind is way over...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
7
kcdoell
by: kcdoell | last post by:
Hello: I have a continous form that displays various forecasting records that an End user can add or edit the records (this feeds off of a query that I created called "ReQryForecast"). On that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.