AllExperts > Using MS Access 
Search      
Using MS Access
Volunteer
Answers to thousands of questions
 Home · More Using MS Access Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Rob Henderson
Expertise
I can answer most MS Access design questions. I also welcome questions on database design and implementation and VBA programming questions. I also have expierence in application design for all the Office components (Excel, Outlook, etc).

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > Change text box values as tab through datasheet.txt

Using MS Access - Change text box values as tab through datasheet.txt


Expert: Rob Henderson - 2/9/2005

Question
Neither putting "DoCmd.RunCommand acCmdSaveRecord" after the code for the data sheet text boxes on the subform, "txtSpa", or for the text boxes on the main form, "txtSyn" saves what I enter into the text boxes on the main form "txtSyn", "txtAnt", and "txtEx".

Do I dimension a recordset perhaps?

Still, I just need the use the presently unbound text boxes on the main form "txtSyn", "txtAnt", and "txtEx" for entering records, not just viewing.

------------------

Private Sub txtSpa_GotFocus()

Forms!frmPentaling!txtEx = DLookup("[fldSpaEx]", "tblVoc", "[fldVocID] = " & Me!fldVocId)
DoCmd.RunCommand acCmdSaveRecord

End Sub

-----------

Private Sub txtSyn_LostFocus()
   DoCmd.RunCommand acCmdSaveRecord
End Sub  

Answer
You must put this code in BEFORE you attempt to get the other data. Otherwise, the record is not saved and cannot bring your data back (because until it's saved - it doesn't exist).

You obviously need to complete some initial data for your record - then save it - then attempt your data retrieval.

rob

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.