Add date to existing table using command buttons.

G

Guest

I'm creating a big ole database to use as part of our season package renewal
campaign (I work for a medium/large orchestra) so it will manage our 2000+
subscribers. I have everything set up so it's usable, but I want to do a few
tweaks...

Right now, I have it set up so you can go into a form, clicked 1 of 2
buttons (Renewing or not renewing) and the date will pop up. The status of
renewing/not renewing shows up on the table, however the date (which, to the
best of my knowledge, is bound to a field on the table) does not transfer
over to the table. Is this because there's an IIf() Equation in the field, or
should that not affect it? Any suggestions?
 
F

fredg

I'm creating a big ole database to use as part of our season package renewal
campaign (I work for a medium/large orchestra) so it will manage our 2000+
subscribers. I have everything set up so it's usable, but I want to do a few
tweaks...

Right now, I have it set up so you can go into a form, clicked 1 of 2
buttons (Renewing or not renewing) and the date will pop up. The status of
renewing/not renewing shows up on the table, however the date (which, to the
best of my knowledge, is bound to a field on the table) does not transfer
over to the table. Is this because there's an IIf() Equation in the field, or
should that not affect it? Any suggestions?

A control with a calculated expression is NOT bound to a field in your
table.

It's not clear from your message what the button's actually do and
what you mean by 'the date will pop up', but what you need do is add
code to the renewal button:
[DateField] = Date
So that after you renew the date is automatically saved to your table.
The above will change the date for that record each time you click the
renewal button.
 
G

Guest

Thank you for your response, though it seems like I should clarify.

Each record has a page form (don't know all the technical terms, sorry) and
when people return their invoices, we should go into their page of the form
and hit Either "Renewing" or "Not Renewing" (it defaults at neither), at
which point, it should trigger the appearance of the date that button was
pushed. It should only be pushed once, so the date should stay the same. It
seems to work fine in the form, however it does not transfer the date into
the table.

fredg said:
I'm creating a big ole database to use as part of our season package renewal
campaign (I work for a medium/large orchestra) so it will manage our 2000+
subscribers. I have everything set up so it's usable, but I want to do a few
tweaks...

Right now, I have it set up so you can go into a form, clicked 1 of 2
buttons (Renewing or not renewing) and the date will pop up. The status of
renewing/not renewing shows up on the table, however the date (which, to the
best of my knowledge, is bound to a field on the table) does not transfer
over to the table. Is this because there's an IIf() Equation in the field, or
should that not affect it? Any suggestions?

A control with a calculated expression is NOT bound to a field in your
table.

It's not clear from your message what the button's actually do and
what you mean by 'the date will pop up', but what you need do is add
code to the renewal button:
[DateField] = Date
So that after you renew the date is automatically saved to your table.
The above will change the date for that record each time you click the
renewal button.
 
G

Guest

Here's my current code, if that helps:

=IIf([Renewed?]>0,Date()," ")



fredg said:
I'm creating a big ole database to use as part of our season package renewal
campaign (I work for a medium/large orchestra) so it will manage our 2000+
subscribers. I have everything set up so it's usable, but I want to do a few
tweaks...

Right now, I have it set up so you can go into a form, clicked 1 of 2
buttons (Renewing or not renewing) and the date will pop up. The status of
renewing/not renewing shows up on the table, however the date (which, to the
best of my knowledge, is bound to a field on the table) does not transfer
over to the table. Is this because there's an IIf() Equation in the field, or
should that not affect it? Any suggestions?

A control with a calculated expression is NOT bound to a field in your
table.

It's not clear from your message what the button's actually do and
what you mean by 'the date will pop up', but what you need do is add
code to the renewal button:
[DateField] = Date
So that after you renew the date is automatically saved to your table.
The above will change the date for that record each time you click the
renewal button.
 
F

fredg

Thank you for your response, though it seems like I should clarify.

Each record has a page form (don't know all the technical terms, sorry) and
when people return their invoices, we should go into their page of the form
and hit Either " (it defaults at neither), at
which point, it should trigger the appearance of the date that button was
pushed. It should only be pushed once, so the date should stay the same. It
seems to work fine in the form, however it does not transfer the date into
the table.

fredg said:
I'm creating a big ole database to use as part of our season package renewal
campaign (I work for a medium/large orchestra) so it will manage our 2000+
subscribers. I have everything set up so it's usable, but I want to do a few
tweaks...

Right now, I have it set up so you can go into a form, clicked 1 of 2
buttons (Renewing or not renewing) and the date will pop up. The status of
renewing/not renewing shows up on the table, however the date (which, to the
best of my knowledge, is bound to a field on the table) does not transfer
over to the table. Is this because there's an IIf() Equation in the field, or
should that not affect it? Any suggestions?

A control with a calculated expression is NOT bound to a field in your
table.

It's not clear from your message what the button's actually do and
what you mean by 'the date will pop up', but what you need do is add
code to the renewal button:
[DateField] = Date
So that after you renew the date is automatically saved to your table.
The above will change the date for that record each time you click the
renewal button.

From your added response, your control with
=IIf([Renewed?]>0,Date()," ")
as it's control source will only display the date on the form. It is
not saved.

What kind of a control is "Renewing" or "Not Renewing"?


Is that one control (like a check box which is going to be either
checked or not checked)? A Check box checked value is -1 (not >0).
A Check Box Unchecked value is 0.

If so, code the Check Box AfterUpdate event:

If Me![CheckBoxName] = -1 Then
[DateField] = Date
Else
DateField = Null
End If

Your expression indicated a value of >0, so all I can say is adapt the
above AfterUpdate event into your code for that Renewing/Non Renewing
control(s).
 
G

Guest

Renewing/Not Renewing is a Toggle Button, which defaults at having neither
button pushed (showing the subscriber has not contacted us yet) and a
selected toggle will create a value of 1 or 2.

After a little playing around with VB, starting with your code, I got
everything to work. Thanks!!
 

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

Top