473,662 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code : DoCmd.OpenQuery - and bring result back to form front

I have got this little piece of code that fires on exit of a text box.
It run's my query perfectly based of my form input. But I don't know
how to bring result in my query back to a text box on my form, and
shut down query so I can keep using my form again. Thoughts?

I am getting a little freaked, I am sure this must be easy?

form is; frm_RR_datacapt ure
query is;qprGB_Piece_ SizefromTextBox
textbox is;RR_Adjusted_ GB_Piece_Size_P roduction_Adjus tment
Private Sub RR_Adjusted_GB_ Piece_Size_Prod uction_Adjustme nt_exit(Cancel
As Integer)
DoCmd.OpenQuery "qprGB_Piece_Si zefromTextBox"

End Sub

Cheers
Nov 13 '05 #1
2 5389
ty**********@ho tmail.com (Tyson) wrote in message news:<7f******* *************** ***@posting.goo gle.com>...
I have got this little piece of code that fires on exit of a text box.
It run's my query perfectly based of my form input. But I don't know
how to bring result in my query back to a text box on my form, and
shut down query so I can keep using my form again. Thoughts?

I am getting a little freaked, I am sure this must be easy?

form is; frm_RR_datacapt ure
query is;qprGB_Piece_ SizefromTextBox
textbox is;RR_Adjusted_ GB_Piece_Size_P roduction_Adjus tment
Private Sub RR_Adjusted_GB_ Piece_Size_Prod uction_Adjustme nt_exit(Cancel
As Integer)
DoCmd.OpenQuery "qprGB_Piece_Si zefromTextBox"

End Sub

Cheers


Hmm... one way is to create an unbound subform and assign the
recordsource to the query and then bind the subform the the query at
runtime...
Nov 13 '05 #2
pi********@hotm ail.com (Pieter Linden) wrote in message news:<bf******* *************** ****@posting.go ogle.com>...
ty**********@ho tmail.com (Tyson) wrote in message news:<7f******* *************** ***@posting.goo gle.com>...
I have got this little piece of code that fires on exit of a text box.
It run's my query perfectly based of my form input. But I don't know
how to bring result in my query back to a text box on my form, and
shut down query so I can keep using my form again. Thoughts?

I am getting a little freaked, I am sure this must be easy?

form is; frm_RR_datacapt ure
query is;qprGB_Piece_ SizefromTextBox
textbox is;RR_Adjusted_ GB_Piece_Size_P roduction_Adjus tment
Private Sub RR_Adjusted_GB_ Piece_Size_Prod uction_Adjustme nt_exit(Cancel
As Integer)
DoCmd.OpenQuery "qprGB_Piece_Si zefromTextBox"

End Sub

Cheers


Hmm... one way is to create an unbound subform and assign the
recordsource to the query and then bind the subform the the query at
runtime...

Hi, Thanks...

Is there anyway I can do it without a subform so it is all run from
the one main form?

Option 1; I was thinking i would like to add a little code after the
Open.query statement above to bring it back to a text box?

Option 2; The other thought I had was a Dlookup but have tried that
and it doesn't seem to work? could it be a text thing?

I like option 1, but do not have the skill base to write code to do
this? Would you be able to help?

Sorry about the length of the names here!!!!

form is; frm_RR_datacapt ure
table is; tbl_GB_Piece_Si ze
query is;qprGB_Piece_ SizefromTextBox
textbox is;RR_Adjusted_ GB_Piece_Size_P roduction_Adjus tment
Lookup Column is Piece_Size
Column I am wanting a return value from is called :
Production_Adju stment

I hope this helps, I am really stuck...

Thanks
Tys.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
13289
by: NB | last post by:
Hi Is there any way to call up the query design view from code? In my compiled-as-MDE app everything is hidden from end users. However, I want advanced user to have access to the query design view so they can create, run and export their own query. Another question is: can they be prevented from saving those on-the-fly queries?
2
3161
by: Stu | last post by:
Hi, I've been working on trying to use a combo box to filter my records for a while now, and can't get it to work. Right now, I have SQL code written into IfThen statements on the afterupdate for the combobox. I tried using the docmd.runSQL but from looking at previous posts, it seems that I need to use DoCmd.OpenQuery instead since I do not have an action SQL statement. The short term problem is that when the user selects from the...
1
3203
by: Eric | last post by:
When I run my script it gives error on the following line: strEmail = Right(strEmail, (Len(strEmail) - 1)) I enclose my code and the sample text file too Thanks, ----------------------------------------------------------------------------- Option Compare Database Option Explicit Private Sub Command26_Click()
3
9498
by: jpr | last post by:
Hello, I have a form on which I have a cmdbutton to copy a couple of fields into another table (MASTER) using the SSN on the active form as criteria. In the active form (based on a tables called LIST) the ssn fields is named CN while in the table where I want to copy this record, the field is named SSN. Basically I am running an append query using code but would like to add a code that will verify if a record with a similar
7
2944
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I need the flexibility of being able to move the BE data to wherever I want, without manually going through this process. I just want to change the Path/Filename that I keep in a FE Table. I want to be able to place a Path/Filename in a FE Table...
3
1682
matrekz42
by: matrekz42 | last post by:
Good morning folks, I have a progress bar in a form, and I would like to run the code for the progress bar through a Macro, so after each query finishes running, the bar will change. Is this possible? I had the following code in VB, where do I place this in the Macro? Private Sub Run_Click() DoCmd.Hourglass True 'Turns off the Access warning messages DoCmd.SetWarnings False Dim stDocName As String
0
2038
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in house case number, appt date and time) for the applicants yearly history and the childs yearly history and then print a report with the applicants info and this in house case number. The forms are linked with ID_app (from the applicant table).
10
7616
by: teddysnips | last post by:
My clients have asked me to maintain a database that was developed in- house. It's pretty good, considering the developer isn't a "programmer". The first thing they want me to do is to split it into a Front End/ Back End, which is very sensible. However, there are a number of ad hoc queries that are required to be available to all users, which can be edited, deleted or created "on the fly". The most sensible solution would seem to be...
3
1733
by: lukethegooner | last post by:
I can't see the wood for the tree's here, I have some code set up to run through a bunch of delete queries, re-append fresh information to local DB tables then run a report. But in the code below the Append queires (stDocName40 thru' stDocName45) don't run (info does not append to the table) when I execute the code. I don't see why it doesn't work and I'm confused. Any ideas? I've checked, double checked and triple checked for any...
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.