Update control based on selection from combo box

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

Guest

Hello,
I'm using Access 03. I have a form that tracks client phone calls. For
each phone call made, we create a record with CallDate, Subject and
FollowupDate as the fields. Another field is called SelFollow which is an
unbound combo box containing choices: 1 Day, 2 Days, 7 Days, 30 Days, etc.
and is used to select and insert the date in the Followup Date field.

To calculate the followup date, I am testing the following code on the
AfterUpdate event on the SelFollowup field:

Private Sub SelFollowup_AfterUpdate()

If SelFollowup.Value = "1 Day" Then followup Date = CallDate + 1

End Sub

When I click on SelFollowup combo box I get the following error message:

Member already exists in an object module from which this object module
derives.

I've searched through the groups to see if I can figure this out but no
luck. Can anyone help? Thanks much.
 
Angie said:
Hello,
I'm using Access 03. I have a form that tracks client phone calls. For
each phone call made, we create a record with CallDate, Subject and
FollowupDate as the fields. Another field is called SelFollow which is an
unbound combo box containing choices: 1 Day, 2 Days, 7 Days, 30 Days, etc.
and is used to select and insert the date in the Followup Date field.

To calculate the followup date, I am testing the following code on the
AfterUpdate event on the SelFollowup field:

Private Sub SelFollowup_AfterUpdate()

If SelFollowup.Value = "1 Day" Then followup Date = CallDate + 1

End Sub

When I click on SelFollowup combo box I get the following error message:

Member already exists in an object module from which this object module
derives.


That sure is a cryptic message that means nothing to me.

If SelFollowup = "1 Day" Then FollowupDate = CallDate + 1

I suspect the problem is the space in FollowupDate:

You used the name both with and without a space so maybe it
really needs the space, if som then enclose the name in [ ]

If SelFollowup = "1 Day" Then [Followup Date] = CallDate + 1
 
Thanks for your help. Actually the field name is [Followup_Date]. I used
the brackets and I got the same message.

Let me reword this, I want to make a selection from a combo box containing 1
Day, 2 Days, 7 Days and populate a date field on my form based on the choice.


Call Date Subject Select Followup(combo) Followup
Date
4/25/06 XXX 1 Day
4/26/06

Is there an easy way to do this? Thanks again.

Marshall Barton said:
Angie said:
Hello,
I'm using Access 03. I have a form that tracks client phone calls. For
each phone call made, we create a record with CallDate, Subject and
FollowupDate as the fields. Another field is called SelFollow which is an
unbound combo box containing choices: 1 Day, 2 Days, 7 Days, 30 Days, etc.
and is used to select and insert the date in the Followup Date field.

To calculate the followup date, I am testing the following code on the
AfterUpdate event on the SelFollowup field:

Private Sub SelFollowup_AfterUpdate()

If SelFollowup.Value = "1 Day" Then followup Date = CallDate + 1

End Sub

When I click on SelFollowup combo box I get the following error message:

Member already exists in an object module from which this object module
derives.


That sure is a cryptic message that means nothing to me.

If SelFollowup = "1 Day" Then FollowupDate = CallDate + 1

I suspect the problem is the space in FollowupDate:

You used the name both with and without a space so maybe it
really needs the space, if som then enclose the name in [ ]

If SelFollowup = "1 Day" Then [Followup Date] = CallDate + 1
 
That error message is beyond me. Either your data base is
partially hosed or there is some kind of strange name
conflict. Try qualifying the caontrol names to see if it
helps.

If Me.SelFollowup = "1 Day" Then
Me.[Followup_Date] = Me.CallDate + 1
End If

I would avoid all the If checks and add a column to the
combo box's RwoSource to specify the number of days to add.
So the Row source table would have two fields. E.g.

Days Description
1 1 day
2 2 days
7 1 week
30 1 month

Then set the combo box's bound column to 1 and its
ColumnWidths to 0;1

This way the combo's Value would be the number of days and
the code would simply be:
Me.[Followup_Date] = Me.CallDate + Me.SelFollowup
--
Marsh
MVP [MS Access]

Thanks for your help. Actually the field name is [Followup_Date]. I used
the brackets and I got the same message.

Let me reword this, I want to make a selection from a combo box containing 1
Day, 2 Days, 7 Days and populate a date field on my form based on the choice.


Call Date Subject Select Followup(combo) Followup
Date
4/25/06 XXX 1 Day
4/26/06

Is there an easy way to do this? Thanks again.

Marshall Barton said:
Angie said:
Hello,
I'm using Access 03. I have a form that tracks client phone calls. For
each phone call made, we create a record with CallDate, Subject and
FollowupDate as the fields. Another field is called SelFollow which is an
unbound combo box containing choices: 1 Day, 2 Days, 7 Days, 30 Days, etc.
and is used to select and insert the date in the Followup Date field.

To calculate the followup date, I am testing the following code on the
AfterUpdate event on the SelFollowup field:

Private Sub SelFollowup_AfterUpdate()

If SelFollowup.Value = "1 Day" Then followup Date = CallDate + 1

End Sub

When I click on SelFollowup combo box I get the following error message:

Member already exists in an object module from which this object module
derives.


That sure is a cryptic message that means nothing to me.

If SelFollowup = "1 Day" Then FollowupDate = CallDate + 1

I suspect the problem is the space in FollowupDate:

You used the name both with and without a space so maybe it
really needs the space, if som then enclose the name in [ ]

If SelFollowup = "1 Day" Then [Followup Date] = CallDate + 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top