473,886 Members | 2,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to update only one field in a form? (DLookup / recalc / requery)

15 New Member
Hello,

On an LostFocus event I'm trying to update another field that is tied to a DLookUp query.

I'm able to update all the form fields but I don't find a way to update only one field.

The below tests update all the fields
Expand|Select|Wrap|Line Numbers
  1. - Me.Recalc
  2. - Me.Controls("Txtbox_RatioDev2").Recalc
  3. - Me.Requery
  4. - Me!Txtbox_RatioDev2.Requery
  5. - Forms("Description").Controls("Txtbox_RatioDev2").Requery
  6.  

Theses examples are not working:
Expand|Select|Wrap|Line Numbers
  1. - Me.Controls("Txtbox_RatioDev2").Recalc
  2. - Forms("Description").Controls("Txtbox_RatioDev2")
  3.  
So is it possible or am I stuck to requery and so update all the form?

Thanks.
Jun 23 '09 #1
6 10236
ADezii
8,834 Recognized Expert Expert
@deewe
The Recalc Method will immediately Update all Calculated Controls on a Form. It applies only to a Form, so individual Controls cannot be Recalculated.
Jun 23 '09 #2
deewe
15 New Member
@ADezii
Thanks for the highlight!

I guess it's the same for the Requery Method then.
Jun 23 '09 #3
yarbrough40
320 Contributor
try it without "!" and use "."
Expand|Select|Wrap|Line Numbers
  1. Me.Txtbox_RatioDev2.Requery
  2.  
if that doesn't work.. what WILL work is retyping the formula for that control's value
Expand|Select|Wrap|Line Numbers
  1. Me.Txtbox_RatioDev2.Value = DLookup("[SID]", "UserTable", "[PrimKey] = 3")
  2.  
Jun 24 '09 #4
ADezii
8,834 Recognized Expert Expert
What will work is Saving the Record, then Requerying the Control:
Expand|Select|Wrap|Line Numbers
  1. SendKeys "+{ENTER}", True
  2. Me![txtTest].Requery
Jun 24 '09 #5
deewe
15 New Member
@ADezii
Hello Adezii,

I tested it and it still updates all fields in the from. No big deal though.
Jun 25 '09 #6
yarbrough40
320 Contributor
Again - you may have to simply send the value of the control again (see my code suggestion above) I promise it works!
Jun 25 '09 #7

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

Similar topics

2
3907
by: John Baker | last post by:
Hi: Hi: I have a form which is based on a query, and is being used to update a table. It all works well, except for one thing. I have a number of unbound calculation fields (total value, Labor Value, etc) which are based on the contents of the records. Within the records themselves there are also calculated fields (Line item value). When I change a critical field (price per unit), and do a Refresh (through a macro linked to the after...
4
26211
by: N. Graves | last post by:
Hello... thank you for your time. I have a form that has a List box of equipotent records and a sub form that will show the data of the equipment select from the list box. Is it possible to make a change in the name field in the details, then refresh the list box with new name? Please help and thanks!
2
2492
by: Uwe Range | last post by:
Hi to all, I am working on a form with a combi-field on a subform. I want to give the user the opportunity to alter the list-content (which is based on a table) in a separate form. The user can call the edit form while the main form stays open in the background (so the user gets back to the spot / record after closing the edit form).
3
5016
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated fields whose DefaultValue property is set to something like DLookUp("","tblVehicleJobs","=Forms!frmEnterLienAmounts!VehicleJobID") The form (frmEnterLienAmounts) has, as one of its bound fields . As I scroll through the records, one-
7
1824
by: gthompson | last post by:
Is this possible: Read fields(rows/columns) from one sql database table (TableA). Then edit/update the same 'field' in TableA; and in TableB edit/update a different field - all at the same time? This is the current situation in an Access Form using Sql for the backend. We would like to convert this Access Form to a Web Form using Visual Studio.net and VB.net. Please help. Thanks, gthompson
6
15644
by: eclypz | last post by:
Whe i use a combobox, and i want it to update it's value i use the code ME.cbxname.Requery How can i do that to update the value of a textbox? i have already try to use the same expression, but it doesn't work :(
4
1664
by: bobchabot | last post by:
Ok so I am working on a database where one of the fields is a list of employee names. I want to have a table called "employee names" that my client can enter and delete employee names from. Then the main form where the combo box field will be automatically updated to contain the employee names that were entered. I hope this makes sense. I looked here for help, but its hard to narrow down exaclty the type of help I need. If anyone has...
9
7761
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this error appears. I will be editing records and then a random one will get the error. A bit of background on my form, this will seem a bit lengthy but here is my code. The form has a navigation list which the user can select a record to view. An...
1
1875
beacon
by: beacon | last post by:
Hi everybody, I have an Employee table with the following: Table - Employee -------------------------- ID: AutoNum, PK FName: Text LName: Text Status: Yes/No
0
9956
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
9799
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
10770
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...
1
10872
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5808
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...
1
4627
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
2
4235
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.