Automatic tab

andymac

Registered User.
Local time
Today, 23:54
Joined
Jun 2, 2013
Messages
36
Greetings all.

I'm revising a database I made last year, but want to simplify a couple of things!

Without boring you with too many details - it's a registration database and the form I'm fixing is the "daily sign-in" form (it's for registering children at a conference over number of days).

At present, when you enter a child's 3 digit number, you then have to tab twice to sign them in and return the curser to the "search" box to start the process over again. I've included screenshots below which will hopefully make this understandable.

However, this year don't want to have to click tab twice, only once. Could anyone advise me how to do this?

PS Carriage return would also work, if that's easier.

Pictures:

https://www.dropbox.com/s/spguvtplmc3ibrk/Screen Shot 2014-06-14 at 16.05.51.png

https://www.dropbox.com/s/5org3noejd5muz3/Screen Shot 2014-06-14 at 16.01.52.png
 
At present, when you enter a child's 3 digit number, you then have to tab twice to sign them in and return the curser to the "search" box to start the process over again. I've included screenshots below which will hopefully make this understandable.
Can we assume therefore that the "name" text box is filled pragmatically. If so, you could just set its Tab Stop property to No.
 
Thanks for your reply.

Yes, you assume correctly. However its Tab Stop is already set to no.

Once the number is entered, you tab once to jump to the "present" tick box (which is checked and the record saved through Got_Focus [see attached picture of code in original post]) then you tab again to go back to the "Search" field.

Maybe there is a way to "tab" automatically via MySQL?

Andrew
 
Perhaps some code in the After Update event of the combo box which does:
1 Check the combo has a value selected.
2 Change the value of the check box to -1 (True)
3 Save the current record.
4 Move to a new record.
 
Thanks for this,

That sounds like what I need. Unfortunately I've no idea how to do this! Any ideas or as to where I could find this?

Andy
 
Thanks for this,

That sounds like what I need. Unfortunately I've no idea how to do this! Any ideas or as to where I could find this?

Andy
Perhaps something like this in the After Update event of the combo box control:
Code:
If Nz(Me.ActiveControl,0) <> 0 Then
  Me.[COLOR="Red"]NameOfCheckBoxControl [/COLOR]= -1
  'Me.Dirty = False EDIT: not needed
  DoCmd.GoToRecord acDataForm, , acNewRec
EndIf
You will need to substitute NameOfCheckBoxControl with the actual name of the check box on your form.
 
Last edited:
Great - think I'm finally getting somewhere!

So now when I enter a three digit child number, it jumps to the correct record, and moves the cursor back to the combo box, but still doesn't tick the "present" box? Not sure what I'm doing wrong.

I can upload a copy of the DB if that would help.

Really appreciate your help!
 
Open the form in design view. Take a look at the After Update event in the properties box and you will see that you have selected [Embedded Macro]. Change this to [Event Procedure]
Does that work.
 
Please try:
Code:
If Nz(Me.ActiveControl, 0) <> 0 Then
  Me.Monday = -1
  'Me.Dirty = False EDIT: not needed
  DoCmd.GoToRecord , , acNewRec
End If
 
Well it is behaving now as you requested because records are being added to the table called Details, but the last value remains in the combo box when the new record is shown. If you you the code below the new line of code will remove that selection from the combo box:
Code:
Private Sub Combo32_AfterUpdate()

If Nz(Me.ActiveControl, 0) <> 0 Then
  Me.Monday = -1
  'Me.Dirty = False EDIT: not needed
  DoCmd.GoToRecord , , acNewRec
  [COLOR="Red"][B]Me.ActiveControl = Null[/B][/COLOR]
End If

End Sub
I have only had a cursory look at your tables, but I would suggest that they should be changed. I think it would be better to have a single table to record attendance with a field that stores the date of attendance.
 
Bob,

Yes i agree the entity structures aren't the best, it was a database which evolved and was created under time pressure, i would like to rewrite it some day if i get a chance! As for now, I just need it to work :)

You said records are now being added to details table? Strange, in mine when I enter a number and click tab, the details table doesn't change? Tried it a few different ways (entering lots of numbers in a row / closing the form etc.) but to no avail. Perhaps I'm doing something wrong?
 
I was using the enter key, but I will try with the tab key and see what happens.
 
Well it seems to create new records but I suspect that you will require more data saved than is currently happening.
 
Ah I see what it's doing now at the bottom of the table. Not really what I'm after, as I want the "Monday" tick to appear beside the same of the person who's ID I type in.
 
I would suggest you put the following line in the forms On Open event:
DoCmd.GoToRecord , , acNewRec
and the following line in the forms Before Update event:
Me.Child_Name = Me.Combo32.Column(1)
 

Users who are viewing this thread

Back
Top Bottom