How would i go about taking the text out of txt1 and place it in a table with a column header textbox1 when i press cmd1
Thanks!
9 1517
There are a few ways you could do it, but I would probably place this into the click event for the button: -
DoCmd.RunSQL "INSERT INTO tablename (textbox1) SELECT '" & me.txt1 & "'";
-
There are a few ways you could do it, but I would probably place this into the click event for the button: -
DoCmd.RunSQL "INSERT INTO tablename (textbox1) SELECT '" & me.txt1 & "'";
-
Thanks for the help that worked wonderfully. Now my next question is how do i get a name from a query to the textbox?
It depends on the query, could you post the sql for your query and I'll incorporate that into an example on how to do it.
It depends on the query, could you post the sql for your query and I'll incorporate that into an example on how to do it.
Here is the query
SELECT MasterZip.Territory AS Territory, Count(MasterZip.[ZIP Code]) AS [CountOfZIP Code], Sum(MasterZip.MVRs) AS SumOfMVRs, Sum(MasterZip.Outlets) AS SumOfOutlets
FROM MasterZip
GROUP BY MasterZip.Territory
HAVING (((Left([MasterZip].[Territory],4))=[Please enter the Territory Number]));
I should also have asked, what field are you interested in populating the textbox with?
I should also have asked, what field are you interested in populating the textbox with?
the textbox names are txtTerritory, txtMVR, txtOutlets. Is this what you're talking about?
Using a parameterized query makes this difficult, but typically if all you are returning is one value then I find a dlookup the best way to go. A dlookup takes two required parameters and one optional. The first is the field that contains the value you are interested in, the second is the table or query the field is contained within, and the the third is an optional criteria, it then returns the value from the field you specified in the first argument based on the result set of the query. In your case you can use your existing query. The only change you would have to make is instead of passing it the parameter of [Please Enter the territory number] you will need to give it that value such as from a textbox or some other input control on the form, then place the value of that control in your HAVING clause -
HAVING (Left([MasterZip].[Territory],4))= RelevantControlValue));
-
Assuming that once this query is constrained to a territory it only returns one record then you can return any value from any of the fields for instance (assume your query is named query1): -
txtTerritory = dlookup("[Territory]","Query1")
-
ok I'll give it a try. Thanks!
Let me know if you have questions, there are several simple things that could cause this to fail, so if it doesn't work we can certainly work through that.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rick Caborn |
last post by:
Does anyone know of a way to execute sql code from a dynamically built
text field?
Before beginning, let me state that I know this db architecture is
built solely for frustration and I hope to...
|
by: BiNZGi |
last post by:
Hi
I have reduced the problem to this code:
<form>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><input type="text" style="width: 100%;" value="Lorem ipsum
dolor...
|
by: Kevin Chambers |
last post by:
Hi all--
In an attempt to commit an Access MDB to a versioning system (subversion),
I'm trying to figure out how to convert a jet table's metadata to text, a
la SaveAsText. The end goal is to...
|
by: sellcraig |
last post by:
Microsoft access
2 tables
table "data main" contains a field called "code"
table "ddw1" is created from a make table query of "data main"
Goal-
the data in "code" field in needs to...
|
by: acecraig100 |
last post by:
I am fairly new to Javascript. I have a form that users fill out to
enter an animal to exhibit at a fair. Because we have no way of
knowing, how many animals a user may enter, I created a table...
|
by: w33nie |
last post by:
I want to disable the text boxes, captain_name and captain_email, but only if the radio button, captain_guarantee, has NOT been checked.
how do i do this?
<form name="formTeamApplication"...
|
by: =?Utf-8?B?S2VzdGZpZWxk?= |
last post by:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one...
|
by: Stevo |
last post by:
I've found that for IE6+, if you add the property text-align:center to a
DIV, then *anything* inside it gets centered. That can be a table, an
object/embed, another DIV, an image, or some text.
...
|
by: semomaniz |
last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
|
by: happyse27 |
last post by:
Hi All,
I wanted to align the text box for user registration but the code just wont budge... Kindly advise what is wrong?
Cheers...
Andrew
<HTML>
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
| |