tabbing in forms/subforms

McRoberts

Registered User.
Local time
Today, 15:02
Joined
Feb 7, 2006
Messages
28
I have search the forum and have found many solutions to this same problem but so far none have worked for me. I am fairly new to Access so maybe I am just not understanding properly.

I have a form with a main form and many subforms. All subforms but one are continuous and the other is a single form that does not allow additions.

1. I can tab from the main form to the first subform but can’t get the next subform.
I have tried this on the exit of the first combo box in the subform

Private Sub EventInitialActionTaken_Exit(Cancel As Integer)
If IsNull(Me.EventInitialActionTaken) Then
Me.Parent.[frmeventFsubform].SetFocus
End If
End Sub

This works until I open a new record from one of the subforms and then I get an error.

2. Then, my last subform is the single form with no additions and I want it to tab to a command button on the main form. Right now it just goes in circles throughout the sub form

3. Also, if I ask to start a new record while my cursor is in one of the subforms, the new record will open with my cursor in that subform field. How do I get it to default to the first field in the main form? I tried Me.EventID.Setfocus on the On Load Event of the main form but this didn’t work.

I think that if I get the answer to question 3 then the code I previously used in question 1 might work.

Any help would be greatly appreciated.
Thank you in advance.
 
Hello Roberts!

Put this code in On Current event.
 
I put this code on the On Current Event of each subform and it didn't work. Maybe I don't understand properly. Can you explain further?
Sorry
 
I suppose the field "EventID" is in MAIN FORM,
put this code only in Main Form.
 
That worked liked a charm. Thanks a lot for your help.
I am on my last subform which is a single form and when I tab off of the last text box I would like it to go to a command button on my main form. Do you know how I would do this?
Thanks again in advance.
 
is it possible to use tabbed forms with each form in the tab entering details into dif tables that are linked..
for example, i have a Job table, a customer table, a driver table.. etc
all my tables are linked... obviously the driver/customer and so on will be assigned to a job. so would it be possible to have a main job form, and then tabs for the driver, customer.. which are on dif tables?
 
Yes, this is what I just accomplished. I have a main form and several subforms that are linked together by the "EventID" in the main form.
On the first control of each subform put the following code on the "on exit" event function and if the control is blank it will tab to the next subform.

If IsNull (Me.InsertNameofControl that you are on) Then
Me. Parent.[Insert Name of form that you want it to go to ie frmcustomerssubform].SetFocus
End If

Hope this helps
 
ok, im a little bit lame with controls, but shall i do this.. create my main form, then create all the tabbed sections..
then in each tabbed form i can select the record source and place the fields that are relevant from the separate tables..
is that the correct way to start?
 
Create your main form using the main table (Job Table) and select the fields that you want in that form. Then create subforms underneath the main form for your Customers and Drivers. Use your control wizard and select the subforms button from the toolbar and it will guide you through it (which tables your fields are coming from, etc). If your relationships are set properly it will automatically bring up which fields you want to link to your main form.
In my case I have an EventID in my main form and all of my subforms that link together.
 
ok, i get you.. however my situation is slightly more complicated then this..

lets say these will be the titles for my subforms..

JOB - PICKUP - DESTINATION - DRIVER - PAYMENT

the driver could be either our driver, a subout driver, or a subout company.. (again 3 separate tables linked to the job id) and the payment could be either cash, cheque or credit card (again 3 tables linked with job id)

with things like pickup and destination, it will work ok because there is one pickup linked to one job using the pickup id and job id.. but when there are more possibilities will this system still work?
 
If understand correctly, I think that you need to make a combo box that you can select either driver, subout driver or subout company and a combo box below it that lists all the different information for driver, subout driver and subout company when you click that particular selection from the first combo box. I had to do the same thing as I have event categories and several event types under each category. You should look up cascading combos in the forms section or check out http://www.fontstuff.com/access/acctut10.htm. This is where I got my information. I ended up using example 2 but example 1 might work best with your database.
 
damn, my database is more complicated then i first thought.. ok ive just messed around with the subforms and it seems that you can only link two tables together that have a direct relationship..

can you not link more than 2 tables of info together in a subform?
also i think i am gettin confused with tabbed and sub forms...

are tabbed forms used when you cant fit all the fields of one table in a single form without scrolling.. can tabbed forms be associated with multiple tables..
 
I am sorry for making this sound complicated. Maybe I am not the best advice giver. I am not even sure what tabbing forms are.
Maybe someone else could help you.
Sorry again.
 
Hello Roberts!

Try this; on "On Lost Focus" event (last text box) put this code:
Me.Parent.CommandName.SetFocus
 
Hello Antonyx!

I think you have to make a good NORMALIZATION (DATABASE NORMALIZATION), of your tables first. Then you can to make
a MAIN FORM and some subforms, (tabs, and in evry tab put one
subform). I have got 14 tabs (14 subforms) in one main form.
 
Thank you for your help MStef. I have everything working now except for the tabbing between my continuous subforms.
The first continuous subform has cascading combo boxes. One combo box selects the event category and then next combo boxes only show those event types that are applicable to the event category. In this particular subform I am getting blank record when I just tab to the next record.
What is the best way to tab through continuous subforms showing the active record when you tab down to the next subform?
Thanks again for your help.
 

Users who are viewing this thread

Back
Top Bottom