How do I make a field "Auto Data Enter"?

Trying to make a field in a form "Auto Enter" Data

Page 1 of 1

1 Replies - 7137 Views - Last Post: 11 October 2006 - 06:06 PM Rate Topic: -----

#1 BlackFireNova  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 25-September 06

How do I make a field "Auto Data Enter"?

Post icon  Posted 30 September 2006 - 02:22 AM

Working in Access 2003, Windows XP Pro.

I have designed a Master form from which I can launch another form, to enter details of an appointment, which are related to the record showing in the Master Form.

I have set up code in the "On Got Focus" section of the Foreign key field of the form which opens which makes the datasource of that field the primary ID field of the record in the Master form.

The code I'm using in the field is:
[Code] Me.ActiveControl = Forms!F_KSM_Contacts_Nt!SM_Contacts_ID [Code/]

My trouble is, even though my code works correctly for pulling the desired data into the foreign key field, I still have to have my people tab through the fields in order to action the code, and get the data pulled into the field. This allows for the potential for them to change or delete the data, which would then destroy my foreign key field reference.

I would much prefer to have the Foreign key field update on the form launching. I could then make the field a locked field, with no tab stop. Then I wouldn't have to worry about some user changing the data, and destroying my foreign key link.

Can someone suggest where, and what I can add to make this happen? Please offer good explanation, as I'm a bit green about translating Example Syntax into "Real" Syntax.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How do I make a field "Auto Data Enter"?

#2 dedman  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 52
  • Joined: 22-April 05

Re: How do I make a field "Auto Data Enter"?

Posted 11 October 2006 - 06:06 PM

Try using
 DoCmd.RunCommand acCmdSaveRecord 
in the same procedure, but at the very end.

Or use
 DoCmd.RunCommand acCmdRefresh 
again in the same procedure, but at the very end.

NOTE: You will not be able to UNDO changes at this point, because of the SAVE/REFRESH. As long as that is not an issue...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1