Combo box formatting issues

  • Thread starter Thread starter Mithrial via AccessMonster.com
  • Start date Start date
M

Mithrial via AccessMonster.com

I'm using VB to attempt to autopopulate a tabular form I created to maintain
track of my company's open projects. A friend of mine provided the code that
allows me to pull my information from my query. The problem is, is that my
query has over 20 columns and every time I attempt to use my code to pull
from any column past the 9th in my query nothing happens. Below is a snippet
of the code I'm using.

Private Sub Combo100_AfterUpdate()

Me.Text102 = Me.Combo100.Column(1)
Me.Text110 = Me.Combo100.Column(2)
Me.Text112 = Me.Combo100.Column(6)
Me.Text114 = Me.Combo100.Column(7)
Me.Text116 = Me.Combo100.Column(3)
Me.Text118 = Me.Combo100.Column(0)
Me.Project_1 = Me.Combo100.Column(5)
Me.Project_2 = Me.Combo100.Column(8)



End Sub

Me.Project_2 = Me.Combo100.Column(10) (Won't work or any number referenced
over 9 for that matter provides no results)

Am I missing syntax that causes this or is there a limitation with this
command?
 
Is there some reason you are doing this this way?
Is this an unbound form?
Can you describe what it is you want to do, please.

Check to see what the Column Count property is. It should be the same as
the number of fields in the combo's row source, which is the only limit I am
aware of.
 
I don't believe my problem to be a difficult one however I've not worked in
Access for several years and I've forgotten a lot of what I learned. What I'm
attempting to do is this.I've created a tabular form. The first page or tab
if you will ask the user to select from one of four drop down lists. Based on
the what item is selected from these lists... i.e., Project Managers, the
selection would port the user over to another page where the created fields
(Open projects, date, status and priority) are autopopulated. A friend of
mine in the office used a linked form with this code and he was able to
autopopulate his form. He gave it to me to use to do somethin similar. If
there is another or more streamline way of doing this any help you provide
would be greatly appreciated. Again, my knowledge of Access is limited so I
appreciate your patience in advance. (In answer to one of your questions, yes
this is an unbound form... I wasn't sure how else to do this) How do I check
to see what the "Column Count Property" is?
Is there some reason you are doing this this way?
Is this an unbound form?
Can you describe what it is you want to do, please.

Check to see what the Column Count property is. It should be the same as
the number of fields in the combo's row source, which is the only limit I am
aware of.
I'm using VB to attempt to autopopulate a tabular form I created to maintain
track of my company's open projects. A friend of mine provided the code that
[quoted text clipped - 23 lines]
Am I missing syntax that causes this or is there a limitation with this
command?
 
To start with, it is better to use bound forms. Using Unbound form's causes
you to loose a lot of the power of Access. It also is more work because you
have to code everything yourself.
I would recommend you take this approach:
If all tabs on the form are using data from the same table or query, then
use the query or table (I suggest a query even if it is just one table) as
the Form's Record Source. Then bind each field you want to use to a control.
You can put the controls on the pages you want to to group them all together.

If each tab is a different table or query, then put a subform control on
each tab and make the Record Source of the form being used as a subform the
query for the data on that tab.

Now the only thing to do is the navigation. That is, the technique on the
first tab to navigate to the other tabs.

Before we get to that, post back with some info on your data. Is it all in
one table or is it a separate table or query for each form. I will help walk
you through it. What you are doing is fairly advanced.
--
Dave Hargis, Microsoft Access MVP


Mithrial via AccessMonster.com said:
I don't believe my problem to be a difficult one however I've not worked in
Access for several years and I've forgotten a lot of what I learned. What I'm
attempting to do is this.I've created a tabular form. The first page or tab
if you will ask the user to select from one of four drop down lists. Based on
the what item is selected from these lists... i.e., Project Managers, the
selection would port the user over to another page where the created fields
(Open projects, date, status and priority) are autopopulated. A friend of
mine in the office used a linked form with this code and he was able to
autopopulate his form. He gave it to me to use to do somethin similar. If
there is another or more streamline way of doing this any help you provide
would be greatly appreciated. Again, my knowledge of Access is limited so I
appreciate your patience in advance. (In answer to one of your questions, yes
this is an unbound form... I wasn't sure how else to do this) How do I check
to see what the "Column Count Property" is?
Is there some reason you are doing this this way?
Is this an unbound form?
Can you describe what it is you want to do, please.

Check to see what the Column Count property is. It should be the same as
the number of fields in the combo's row source, which is the only limit I am
aware of.
I'm using VB to attempt to autopopulate a tabular form I created to maintain
track of my company's open projects. A friend of mine provided the code that
[quoted text clipped - 23 lines]
Am I missing syntax that causes this or is there a limitation with this
command?
 
Klatuu,

I'm sorry for the delayed response. I was out of the office on business. I
took your advice and used "bound" objects and the Combo Box wizard to
complete my form. It works like a charm. I would like to, as I mentioned
earlier, have the user select from a drop-down menu on the opening page or
tab and have the form port the user to correct window without any user
interaction (other then the initial selection).

Can you walk me through this? The form contains about 8 tabs, (more or less).
On the opening tab you have four drop down menus (Open Projects, Project
Manager, Project Location, Summary Page) If project location is selected, as
an example, the user can choose from any of the available locations. If they
select Miami, as an example they are ported immediately the location tab with
all open projects under that location. Each location may have multiple
projects associated with its location. I also wanted to ensure that if the
user selected more then one tab from the primary tab this would return a
warning message preventing the user from doing so. (In other words a user
couldn’t select “Open Projects and Project Locations concurrently… this would
return an error message)

Your advice got me going in the right direction quickly. Thanks so far for
your help.
To start with, it is better to use bound forms. Using Unbound form's causes
you to loose a lot of the power of Access. It also is more work because you
have to code everything yourself.
I would recommend you take this approach:
If all tabs on the form are using data from the same table or query, then
use the query or table (I suggest a query even if it is just one table) as
the Form's Record Source. Then bind each field you want to use to a control.
You can put the controls on the pages you want to to group them all together.

If each tab is a different table or query, then put a subform control on
each tab and make the Record Source of the form being used as a subform the
query for the data on that tab.

Now the only thing to do is the navigation. That is, the technique on the
first tab to navigate to the other tabs.

Before we get to that, post back with some info on your data. Is it all in
one table or is it a separate table or query for each form. I will help walk
you through it. What you are doing is fairly advanced.
I don't believe my problem to be a difficult one however I've not worked in
Access for several years and I've forgotten a lot of what I learned. What I'm
[quoted text clipped - 23 lines]
 
Well, first, you can't select more than one item from a combo box, so the
user being able to select more that one is not an issue.

The other thing is I don't quite understand why you want a combo box to
select a tab. The tabs are shown across the top of the control, so all a
user has to do is click on the tab they want to go to. Or, am I missing
something here?
--
Dave Hargis, Microsoft Access MVP


Mithrial via AccessMonster.com said:
Klatuu,

I'm sorry for the delayed response. I was out of the office on business. I
took your advice and used "bound" objects and the Combo Box wizard to
complete my form. It works like a charm. I would like to, as I mentioned
earlier, have the user select from a drop-down menu on the opening page or
tab and have the form port the user to correct window without any user
interaction (other then the initial selection).

Can you walk me through this? The form contains about 8 tabs, (more or less).
On the opening tab you have four drop down menus (Open Projects, Project
Manager, Project Location, Summary Page) If project location is selected, as
an example, the user can choose from any of the available locations. If they
select Miami, as an example they are ported immediately the location tab with
all open projects under that location. Each location may have multiple
projects associated with its location. I also wanted to ensure that if the
user selected more then one tab from the primary tab this would return a
warning message preventing the user from doing so. (In other words a user
couldn’t select “Open Projects and Project Locations concurrently… this would
return an error message)

Your advice got me going in the right direction quickly. Thanks so far for
your help.
To start with, it is better to use bound forms. Using Unbound form's causes
you to loose a lot of the power of Access. It also is more work because you
have to code everything yourself.
I would recommend you take this approach:
If all tabs on the form are using data from the same table or query, then
use the query or table (I suggest a query even if it is just one table) as
the Form's Record Source. Then bind each field you want to use to a control.
You can put the controls on the pages you want to to group them all together.

If each tab is a different table or query, then put a subform control on
each tab and make the Record Source of the form being used as a subform the
query for the data on that tab.

Now the only thing to do is the navigation. That is, the technique on the
first tab to navigate to the other tabs.

Before we get to that, post back with some info on your data. Is it all in
one table or is it a separate table or query for each form. I will help walk
you through it. What you are doing is fairly advanced.
I don't believe my problem to be a difficult one however I've not worked in
Access for several years and I've forgotten a lot of what I learned. What I'm
[quoted text clipped - 23 lines]
Am I missing syntax that causes this or is there a limitation with this
command?
 
My apologies for the confusion... I'm using a drop down list option on the
form which is tabular. There are 5 tabs displayed (Region, Open Projects,
Project Managers, Location, and Summary Tabs). A user selects from one of the
drop down menus (combo box) on the first page of the tab form. When a user
selects an item from one of these drop down menus, a macro automatically
takes them the correpsonding tab (form created on that particular tab). As an
example. If I select an item from the Open Project (combo box) the drop down
list, the window on the form or tab "Open Projects" is displayed with all the
information that has already autopopulated the form. I hope this clears up
your misunderstnding. If not, I can send a screen shot if this will help
matters.

Well, first, you can't select more than one item from a combo box, so the
user being able to select more that one is not an issue.

The other thing is I don't quite understand why you want a combo box to
select a tab. The tabs are shown across the top of the control, so all a
user has to do is click on the tab they want to go to. Or, am I missing
something here?
[quoted text clipped - 44 lines]
 
What I am uderstanding is you have a combo on the first page for each of the
other pages. That would be a combo for Region, one for Open Projects, one for
Project Managers, one for Location, and one for Summary information. What
you want to do is, for example, select a Location from the Location combo and
have the Location tab displayed with the data for the selected Location. If
that is correct, all you need to do is use the After Update event of each
combo the populate the controls on the correct tab and go to that tab's page.

--
Dave Hargis, Microsoft Access MVP


Mithrial via AccessMonster.com said:
My apologies for the confusion... I'm using a drop down list option on the
form which is tabular. There are 5 tabs displayed (Region, Open Projects,
Project Managers, Location, and Summary Tabs). A user selects from one of the
drop down menus (combo box) on the first page of the tab form. When a user
selects an item from one of these drop down menus, a macro automatically
takes them the correpsonding tab (form created on that particular tab). As an
example. If I select an item from the Open Project (combo box) the drop down
list, the window on the form or tab "Open Projects" is displayed with all the
information that has already autopopulated the form. I hope this clears up
your misunderstnding. If not, I can send a screen shot if this will help
matters.

Well, first, you can't select more than one item from a combo box, so the
user being able to select more that one is not an issue.

The other thing is I don't quite understand why you want a combo box to
select a tab. The tabs are shown across the top of the control, so all a
user has to do is click on the tab they want to go to. Or, am I missing
something here?
[quoted text clipped - 44 lines]
Am I missing syntax that causes this or is there a limitation with this
command?
 
Excellent... thank you for your patience and great advice... this works like
a charm.
What I am uderstanding is you have a combo on the first page for each of the
other pages. That would be a combo for Region, one for Open Projects, one for
Project Managers, one for Location, and one for Summary information. What
you want to do is, for example, select a Location from the Location combo and
have the Location tab displayed with the data for the selected Location. If
that is correct, all you need to do is use the After Update event of each
combo the populate the controls on the correct tab and go to that tab's page.
My apologies for the confusion... I'm using a drop down list option on the
form which is tabular. There are 5 tabs displayed (Region, Open Projects,
[quoted text clipped - 20 lines]
 
Can I ask you one other question... I'm writing a Marco that checks the
"closing date" on my form and places a check in the check box I've attached
with the form. Can you help me with how I can do this? What I'm attempting to
do is... after checking the "closing date" if the close date is less then
today's date this will place a check mark in the check box on the form, if
the close date is greater then the today's date the checkbox remains blank.

Bill
 
Back
Top