Navigation subform problem (1 Viewer)

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
Main Form = 'NavForm' Using standard Navigation Form in Access 2010
Subform = 'frmanimalSetup'
Main form combo = 'defaultcboanimalID' Record source = [tblanimal setup]
subform.form.combo = 'cboanimalID' recordsource = [tblanimal setup]

Based on type and/or group and/or location the 'defaultcboanimalID' combo delivers the number of animals within the specified areas.

The frmanimalsetup (subform) has a 'cboanimalID' combo that will call up a record based upon the picked or entered animalID. Keep in mind this combo calls up all records in [tblanimal setup]. This actually works.

What does not work is the ability for the cboanimalID (subform combo) to default or become the same as the 'defaultcboanimalID' (navform combo), thus pulling up a specfic record..

Access will not even recognize the subform 'frmanimalsetup'. I understand that the Navigation subforms are controls themselves but how do you address the controls. I have tried fifty ways and none are any good.

I have looked, read , listened and tried for the last five days to do this and nothing works.Hope someone can help. Thanks in advance.
 

JHB

Have been here a while
Local time
Today, 08:08
Joined
Jun 17, 2012
Messages
7,732
Post a stripped version of you database with some sample data.
 

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
Post a stripped version of you database with some sample data.


Thanks for answering,, will post a small version of it.
 

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
Here it is, I have done little with the look of the navform, can do that at anytime.
\Thanks
Blade
 

Attachments

  • AnimalDB.accdb
    724 KB · Views: 55

JHB

Have been here a while
Local time
Today, 08:08
Joined
Jun 17, 2012
Messages
7,732
To refer to a control on the subform from the mainform:
Code:
Me.NavigationSubform!AnimalSetupID
To refer to a control on the mainform from the subform:
Code:
Me.Parent!cboGroup
I've add a button on the mainform and one on the subform, click them, (look at the code behind it).
 

Attachments

  • AnimalDB.zip
    62.4 KB · Views: 60

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
What is the purpose of the 4 unbound combo boxes along the top of the navform? Are they for searching?

Also your tblAnimalSetup is loaded with lookup fields at the table level.
http://access.mvps.org/access/lookupfields.htm

The 4 cbo's are cascading that allows me (user) to lookup animals depending where they are and how they are classed. The farm is a little different that an ordinary business.

As far as the lookup fields,, thanks for the info. Most of the data is real and I have been using the DB prior to it being finished. More or less am building as I go so I was using them to see if the programming I put into Access did what I wanted it to do. Since at this time it has only a few forms and fewer reports, I needed something. Agree with you, will have to change them back into a # system once, I get this particular set of forms done. This not the recommended way to do things but so far its gets the job done and allows me to get the data from the herd that I need.
Hope this answers your ?s.

Thanks a bunch for the info..
 

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
I did not see any changes that it made. It still does not pull up the animal selected in the mainform animalID combo. with out having to go to the subform and pulling it up via the [cboanimalID].

Sorry I am not too good at expressing what I would like to see here. The group and location and type cbos in the mainform only serve as search parameters for the mainform [defaultcboanimalID].

The frmanimalID would then pull up that animals data using the defaultcboanimalID (that was selected), the [tblanimal setup].AnimalsetupID (auto#) will then show it on screen. The combo boxes other than the cboanimalID on the subform [frmanimalID] will only serve on select items should an edit be needed.

In addition, I do not need to go through the top mainform to get the animals info. If I have an animal at hand, I can simply put in the ear tag ID into the subform [frmanimalsetup].cboanimalID and it will give me the data I need.

example: I have 10 animals in the T/B (treatment/bonding) field and during a storm a tree falls on the fence tearing it down. All animals get out. I can use the top (mainform) search categories to find out which animals I had in there so I can put them back once the fence is fixed.

On the other hand, I cull one animal out of the group to a head gate for treatment. I can simply look at its ear tag, put that number into the subform[frmanimalsetup].cboanimalID (combo) and get the information I need.

Sometimes you need single and sometimes you need multiple.

There are other scenarios, but over time and several starts with other type main screens, I have determined that this type main screen allows the farmer (like myself) the greatest flexibility which might change several times a day in many different directions.

This mainscreen is used throughout the DB with Healthcare, Loss , Sold, Births, etc.......
All sub forms [frm*] will have the same [tblanimalsetup].animalsetupID (auto#), [tblanimalsetup].animalID enabling them to get Animal information from the many different tables available.

Does this make sense to you ?
 
Last edited:

Bladerunner

Registered User.
Local time
Yesterday, 23:08
Joined
Feb 11, 2013
Messages
1,799
What is the purpose of the 4 unbound combo boxes along the top of the navform? Are they for searching?

Also your tblAnimalSetup is loaded with lookup fields at the table level.
http://access.mvps.org/access/lookupfields.htm

have a quick ? for you. I was under the impression that when the row source is = to this:
SELECT [tblGroup].GroupID, [tblGroup].[Groups] FROM tblGroup;

and the GroupID is the bound column, it is not a lookup level .

If I take out [tblGroup].[Groups] then the field will revert back to a number without any loss of data.

So, what do the lookup fields do if the GroupID is the one that is linked to the record? Thanks again for the help.
Blade
 

AccessBlaster

Registered User.
Local time
Yesterday, 23:08
Joined
May 22, 2010
Messages
5,980
have a quick ? for you. I was under the impression that when the row source is = to this:
SELECT [tblGroup].GroupID, [tblGroup].[Groups] FROM tblGroup;

and the GroupID is the bound column, it is not a lookup level .

If I take out [tblGroup].[Groups] then the field will revert back to a number without any loss of data.

So, what do the lookup fields do if the GroupID is the one that is linked to the record? Thanks again for the help.
Blade
This is fine when used in a combo box's row source at the form level. It's my understanding it can cause corruption when used at the table level.
 

Users who are viewing this thread

Top Bottom