access form

L

LUIS ANGEL

Hello I'm trying to make a simple form that will feed a table. What im looking to do is to have a form with 2 fields; field1 and field 2.

In field1 i want to put a number and that number should stay there till i change it.
in field2 i want to put a number and after hitting <<enter>> both fields should be added to table1. after hitting enter the cursor should stay in field2 to be able to enter the next data and so forth.

any help would appreciated.
 
J

John W. Vinson

Hello I'm trying to make a simple form that will feed a table. What im looking to do is to have a form with 2 fields; field1 and field 2.

In field1 i want to put a number and that number should stay there till i change it.
in field2 i want to put a number and after hitting <<enter>> both fields should be added to table1. after hitting enter the cursor should stay in field2 to be able to enter the next data and so forth.

any help would appreciated.

Put code in the AfterUpdate event of Field1:

Private Sub Field1_AfterUpdate()
Me!Field1.DefaultValue = Chr(34) & Me!Field1 & Chr(34)
End Sub

Chr(34) is the doublequote character " - the DefaultValue propety must be a
text string, whatever the datatype of the table field.

Then set Field1's Tab Stop property to no, and the form's Cycle property to
All Records (that's the default).

Tabbing (or entering) in Field2 will then jump to the new record and set focus
to field2.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top