473,406 Members | 2,281 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,406 software developers and data experts.

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

15
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 10137
ADezii
8,834 Expert 8TB
@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
@ADezii
Thanks for the highlight!

I guess it's the same for the Requery Method then.
Jun 23 '09 #3
yarbrough40
320 100+
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 Expert 8TB
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
@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 100+
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
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,...
4
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...
2
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...
3
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...
7
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?...
6
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,...
4
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...
9
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...
1
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
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.