Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Store a value from header
Dan Jackson 
            
4 years ago
Hi Guys,

I have a continuous form. I currently have an unbound text box which the user will type a number into (Simple, like 5 or 8).
I'd like to store that number for next use but the problem is its in the header so can't accompany the records.

I'm going to take my first step in setting up a very simple authentication setup using a table to store the users password so it could be stored in that table but how would I link the text box to that table? Is this a SQL thing? Thanks
Alex Hedley  @Reply  
           
4 years ago
DLOOKUP?
Dan Jackson OP  @Reply  
            
4 years ago
Ok, so I add another field to my user table to store the value, then use DLOOKUP to read that value from the table.

When the value is changed, do i need to do anything in the AFTER UPDATE to write the new value into the table? I'm assuming dlookup will only read the value to the text box, not go back the other way. Thank you

I'm thinking about adding + / - buttons and locking the text field so i could add the code to those buttons instead of an after update event. Either way, i need to be able to write any new values to the table
Alex Hedley  @Reply  
           
4 years ago
Just bind it to a Table or Query?
Dan Jackson OP  @Reply  
            
4 years ago
Problem is, I have about 3 different users, its need to show the value based on whos logged in hence the requirement for dlookup.

The form is also bound to a table already so i'd need to do a multi-table query which is frowned upon
Alex Hedley  @Reply  
           
4 years ago
Why does the value need writing back then?

(You can join as many tables in a query as you like)
Dan Jackson OP  @Reply  
            
4 years ago
Its number of days worked for the person logged in so...

Person A Logs in and types the value 15
When Person A logs in next day, they'll update it to 16 and so on.

I'm going to give this a try Alex, be right back!
Dan Jackson OP  @Reply  
            
4 years ago
I've used DLookup to get the value and works great. I just need to be able to write it back to the table After_Update
Added in Default Value:
=DLookUp("DaysWorked","UserT","UserID=" & [Text_UserID])
Dan Jackson OP  @Reply  
            
4 years ago
Kevin amazingly provided a SQL code in another post to insert a new record for a different problem. I'm looking for something similar to this but to update an existing record instead

CurrentDb.Execute "INSERT INTO YourTable (YourFieldName) " & _
"VALUES (" & YourComboBox & ")"


To Summarise:

On TEXT_DAYSWORKED After Update
Look at USERT for record that matches the userID from TEXT_USERID
Update the field DAYSWORKED

Thank You
Dan Jackson OP  @Reply  
            
4 years ago
Anyone?
Alex Hedley  @Reply  
           
4 years ago
Alex Hedley  @Reply  
           
4 years ago
UPDATE CustomerT
SET CustomerName = 'Dan Jackson'
WHERE CustomerID = 1;
Dan Jackson OP  @Reply  
            
4 years ago
Thanks alex!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 8:52:45 AM. PLT: 1s