store field data using VB code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.
 
Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.
 
I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.
 
Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!
 
I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

Karen53 said:
Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


Klatuu said:
I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.
 
The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

Klatuu said:
I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

Karen53 said:
Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


Klatuu said:
I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
I figured it out. Thanks!

Karen53 said:
The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

Klatuu said:
I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

Karen53 said:
Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


:

I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
OH GOOD!
So what was it? By your last post, I was thinking something has to be wrong
with the combo box.

Karen53 said:
I figured it out. Thanks!

Karen53 said:
The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

Klatuu said:
I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

:

Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


:

I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
I had the record source of the Pop up form set to the query. I removed that
and set the row source of the combo box to the query instead. Works like a
charm. HURRAY!

Thanks again!

Klatuu said:
OH GOOD!
So what was it? By your last post, I was thinking something has to be wrong
with the combo box.

Karen53 said:
I figured it out. Thanks!

Karen53 said:
The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

:

I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

:

Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


:

I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
AHAA! I was wondering why you had navigation buttons on that form. Glad it
worked out for you

Karen53 said:
I had the record source of the Pop up form set to the query. I removed that
and set the row source of the combo box to the query instead. Works like a
charm. HURRAY!

Thanks again!

Klatuu said:
OH GOOD!
So what was it? By your last post, I was thinking something has to be wrong
with the combo box.

Karen53 said:
I figured it out. Thanks!

:

The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

:

I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

:

Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


:

I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
Thanks Klatuu

Klatuu said:
AHAA! I was wondering why you had navigation buttons on that form. Glad it
worked out for you

Karen53 said:
I had the record source of the Pop up form set to the query. I removed that
and set the row source of the combo box to the query instead. Works like a
charm. HURRAY!

Thanks again!

Klatuu said:
OH GOOD!
So what was it? By your last post, I was thinking something has to be wrong
with the combo box.

:

I figured it out. Thanks!

:

The query that the Pop up form is based on filters the selections available
to the combo box. Once the selection is made, it is saves to the main form
text box. Right now I can only navigate through the combo box choices using
the navigation buttons. I would prefer the combo box drop down with the
choices. In short, the combo box isn't working correctly. It shows the
choices but not as a drop down. The drop down arrow doesn't do anything but
bring up a blank.

:

I got a little confused reading your last question. I got lost trying to
understand the relationship between the items on the main form and the combo
box on the pop up form. Are you trying to filter what goes on the main form,
or filter what is in your combo list?

:

Hi Klatuu,

Thank you so much for your help! This is great!

Actually I have already tried something similar to this. The pop up is
another form with it's Pop up property set to yes. I was able to populate
the value in the text box of the main form but it posted to ALL of the
records. I just needed to close the Pop up..Duuuhhh!! I had actually
forgotten about me.

Here's the code I used linked to an command button.

Forms!frmApostmortem![txtsubIssueCause] = Me.cbosubIssueCause

My question now is... My combo box on the Pop up form is set to a query as
it's record source for the filter. There is more than one choice for each
item on the main form. The combo box doesn't drop down with the filtered
values. I have to page through using the navigation buttons to the selection
I want. Any
suggestions?

Thanks again!


:

I assume what you are calling a Pop is a combo box. If so, in the Lost Focus
event of the combo box,
txtFieldtoFill is the text box for the field you want to put the data in
cboPopUpList is the combo box with your filtered list. If this is not a
combo box, then it may or may not work.

Me.txtFieldtoFill = Me.cboPopUpList

It would be a good idea to use correct terminology so that we know exactly
what you are asking. Not gripping, just trying to be helpful.
Since there is no such thing as a Pop up box, I have to guess what it is.

:

Thx Klatuu...

I have a main form open to the current record. From this form, I open a Pop
up with a box to select the value from a filtered list. The list is filtered
according to a value of another field on the main form. I need to save the
Popup value into that one record's field.

:

Need more info. At what point do you want to do this? Is it the current
record in a bound form, the current record in an unbound form. A different
table when you are in a form for another recordset, etc. That will have a
bearing on how.

:

Hi,

I need to store data in one field of a specific record by assigning it in
VB. How would I do this? I am using Access 2002.

Thanks,
 
Back
Top