A strange one!

andymac

Registered User.
Local time
Today, 20:12
Joined
Jun 2, 2013
Messages
36
I haven't been able to google this because I'm not sure how I'd word it!!

I have a form, which registers attendance at an event, with three fields - ID (a combo box), Name, and Present. When an attendee comes in, they give their number which is entered into the first field. Pressing carriage return, their record is loaded, and I can then check the 'present' field. Then I click the next button and await the next person!

I'd like the simplify the whole process - so that as soon as the 3 digit attendee number is typed, the present box for that record is checked, and the form is reset (curser back to the combo box to search for next record).

In short - all the registrar ever has to do is enter a three digit number!

Any help would be very much appreciated.

Andrew
 
I'd probably do it with an unbound form and textbox, but simplest at this point is probably:

Me.CheckboxName =True
DoCmd.GoToRecord...

In the after update event of the attendee textbox. Look in help at GoToRecord for the argument to go to a new record.
 
Hi, reading your code - I'm not sure it does exactly what I want - I want the checkbox to be ticked be solely typing three digits (no requirement to carriage return/enter after data entry).
 
using pbaldy's example, put his code in the ComboBoxes OnChange event checking that 3 didgits have been typed.

EG
If Len(ComboID.Text) = 3 Then
Me.CheckboxName = True
DoCmd.GoToRecord...
End If
 
So here's what I've got:

Using your code, i still have to type in the number then hit enter. Only then when i type 3 digits does it check the box. I want this all to happen in one go?

Also ... I don't understand the DoCmd.GoToRecord... line, as in what I should finish it with?

Sorry, I'm useless at VBA!

Andrew
 
Using your code, i still have to type in the number then hit enter. Only then when i type 3 digits does it check the box. I want this all to happen in one go?

The code i posted should after the 3rd character is typed;
Set your checkbox = True
Move your record to whichever record you specify

If you want to go to a New Record then use;
DoCmd.GotoRecord acDataForm,Me.Name,acNewRec

All of this is dependant on the form you are entering data on. If the form is purely new record entry then acNewRec is correct. However if the form you are using is to edit an existing record, then you would need to specify which record you want to go to next.

I think the best way to help you further would be with a copy of your DB; just the relevant forms and tables. Is this possible?
 
Ok, so I appear to have got everything (nearly) working - but the form is open in edit mode. So how would it specific a GoTo record? (Say even the first record in the 'details' table?)
 
GoToRecord has several constant variables assigned;
  1. acFirst Make the first record the current record.
  2. acGoTo Make the specified record the current record.
  3. acLast Make the last record the current record.
  4. acNewRec Make a new record the current record.
  5. acNext Make the next record the current record.
  6. acPrevious Make the previous record the current record.

Another method you might look at is Move where you specify how many records to move from the current.

In all honesty though, if you are inputting data through a data entry form (which is really the best practice as it avoids corrupting existing data) you only need acNewRec.
 
Ok, I'm keen to make it work with best practice incase something goes wrong!

Here's a link to my database:

https://www.dropbox.com/s/x17q79ulidpynee/SummerFire.accdb

The form in question is "Saturday Registration" (there will be one made for each day)

The DB is flat file (everything is in 'details' table).

As I've said, I want the 'Saturday registration' form to open, and all the user has to do is enter their number, and it 'checks them in', and resets the form for the next user. (Some type of notification for the user that this has been successful would be nice, but not necessary).

I should note that not all 'ID' are three digit - they will be in the final implementation however.

Thanks for all your help today, it really has made my day a lot better!!

Andy
 

Users who are viewing this thread

Back
Top Bottom