Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record in Form does not Update to Table Unless Arrow to Next Blank Rec

Status
Not open for further replies.

0011268899

IS-IT--Management
Nov 4, 2003
8
0
0
US
I have a form that when a user enters information, I would like it to add that new record (or even updated information on an existing record)into my table immediately. My problem is that the record only adds itself in the table only if I click on the arrow button at the bottom of the form to advance to the next blank record. What can I do so that as a user enters in information in a form on one record, the corresponding fields get updated to the table? Thanks in advance!
 
I don't understand why you would want to do this (data validation becomes almost impossible). It can be done though (I think) through VBA, so unless you want the user to be entering the data directly onto the table (just a thought) I could probably whip up some code which will do it for you.
 
If the user is always "Adding" a record you can set the forms Data property to 'Data entry = Yes' but then they will only ever see a blank record when in the form. If you want the user to update field/s where the record already exists they will need to select the record and make adjustments and you continue to have your issue.

You could setup 2 forms one for updating records and another for adding or better still:

You could setup separate text boxes (not linked to a table) and run an conditional macro (or code) to update the records where it exists or to append (add) it where it does not already exist.

I hope that is helpful.
Cheers
 
Well, if I'm not mistaken the database I'm currently working on has validation throughout the VBA code and some set through Access directly. The thing that perplexes me (and forgive me for leaving this out earlier. I just now thought of it) is that I've got a drop down box and when you select the first option, that record transfers to the table ok. But if you pick any other option from that same drop down menu, most of the information does not get input into the table unless you arrow to the next blank record.
 
I'm struggling with a similar problem in that I need to have new entries or changes in one control of a form to cause other controls on the same form to react immediately to the change - including a subform that queries the same base table as the form for other rows whose fields match the new values just entered in the control.

My current tack is to force the recordset underlying the form or the subform to "refresh" itself when the value in the control is updated. I.E.,
Code:
       Form_Myform.Recordset.Refresh
       Form_Mysubform.Recordset.Refresh
as part of the Update event of the control I just changed.

This is working pretty well so far, but I'm too new to Access to know if this is the right way to go about it.
PS, Requery is more powerful, but it resets the pointer to the current row, and I'm not confident I can get back to that row after the Requery completes.
 
It is normal for the table not to be updated until the control has lost focus i.e. when you leave that control 9by moving into another control or clicking anywhere outside that control), otherwise how does access know that your entry is complete, maybe you should add a button that the user can click when they have entered all the relevant data for a record, then that button could perform a function such as goto the next record.
 
0011268899, did you get your problem resolved? The solutions given you turned out to be not what I thought you were asking for. When I enter data, I am using the enter key to go to the next field. For some reason, on this one form, it just keeps going back to my first field, instead of going to a new record so I can just keep adding new records. I thought this was your problem. Was this your problem and did you fix it? I am stumped. Thanks for your help, Janet Lyn
 
Hi janetlyn

Check your form's Cycle property (available under the 'Other' tab on the properties window).

This determines what happens as you tab through the fields on your form. The value you need to set it to is All Records.

Hope this helps.

Mac
 
Mac, actually I resolved my problem. It was that I had the form in the Header and not the Detail section. Thank you for your help and I apologize for not coming back and resolving my question. Have a wonderful day, JL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top