473,513 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help in Updating tqble and getting error2001?

75 New Member
I am getting this error each time I run my form in Access.
I have a table calls "Medications" and it has three colums (Medication_Name, Concentration, Units) then I have another table name Main Table, which grabs the value from the Form and put it in MainTable under Medication_Name, Concentration and Units.

On the form I have a combo box for Mecdication, When User picks MEDICATION the concentration and Units text box get populated by it self. I have a small query for it.

Expand|Select|Wrap|Line Numbers
  1. SELECT Medications.Concentration, Medications.Units
  2. FROM Medications
  3. WHERE (((Medications.Medication_Name)=[Forms]![frmMain]![Medication_Name]));
  4.  

In code thats what I have to fetch the value from the Medications Table and get Concentration and Units Textbox populated, but the problem is the value from Concentration and Units are not getting enterd in the MainTable.
The control source for Concentration is
Expand|Select|Wrap|Line Numbers
  1.  =DLookUp("Concentration","medquery")
and for the Unit is
Expand|Select|Wrap|Line Numbers
  1.  =DLookUp("Units","medquery")


Expand|Select|Wrap|Line Numbers
  1. Private Sub Medication_Name_Change()
  2.  
  3. 'DoCmd.OpenQuery "medquery"
  4.   Me!Concentration.Requery
  5. End Sub
  6.  
I would appreciate if some one cal help me out.
Thx.
Jun 28 '07 #1
2 1359
pukhton
75 New Member
I am not getting any luck, i have tried everything. anybody please?
Jun 28 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
I;m sorry but I'm totally confused about what you are doing.

Firstly, why do you have the same fields in two tables?

Secondly your DLookup queries don't have any criteria set but they can only return one value.
Jul 3 '07 #3

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

Similar topics

13
5427
by: omission9 | last post by:
I have a dictionary that looks like this MY_DICT=FOO I am having a problem updating this with a simple MY_DICT.update(NEW_DICT) as update doesn't seem to care about getting into the inner dicts. Getting the keys of each and iterating through and updating each one is terribly slow as the number of keys gets bigger and bigger. What is the...
0
1532
by: vsaraog | last post by:
Hi y'all, I am using a Created Global Temporary Table in DB2 OS/390 version 7.1.2. I am inserting some data in it and then updating the table using ODBC but while I try to update it, I am getting following message. SQL0526N The requested function does not apply to declared temporary tables. SQLSTATE=42995 Anyone has any ideas why I...
19
4066
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can...
15
4565
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never...
6
2321
by: mike11d11 | last post by:
I'm trying to create an application that will have multiple users working off a table on a SQL server. Since multi users will be updating different records at any given moment, how can i get those changes and merge them into my current Dataset. I've been playing around with the GetChanges method and Acceptchanges but they just dont seem to...
0
1334
by: JimN1 | last post by:
Error: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. This is a continuation of my previous table element update question. I am now getting the above error message. I need help with the format of the SQLAdapter.Update(DSet.Tables(0)) command. I have included my code below. The line is in bold text....
14
2127
by: bcap | last post by:
Hello, I really would apprciate help! =) What I want to do is be able to change the status of mulitple records using a drop down and a checkbox. I have a drop down called "ChangeStatus" with the values to change the status to Pending, Accepted, Declined, Cancelled, Completed.
11
1866
by: xelA | last post by:
Thanks, it worked. Another problem: Hey folks, where is the bug in this code? When updating the date field, it is updating all the records in the table with the same value (e.g. 2008-01-07) instead of incrementing the day by one in each record. $schedule=position_courses($time_of_day); $x=0; $z=0; $temp=0; ...
2
3300
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the CurrentChanged event of the BindingSource of the combobox to update the textbox. When selecting an item in the combobox or when selecting a row in the grid,...
0
7397
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7128
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
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...
0
5704
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...
0
3255
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...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.