Valery
Registered User.
- Local time
- Today, 14:25
- Joined
- Jun 22, 2013
- Messages
- 363
Hi,
I only know enough VBA to insert codes in the right place! Here is what we would like – in plain English. Can you “translate” in VBA?
It is a continuous subform (Names: Form = ClientUpdate / Subform = ClientUpdateSub. All of the data implicated here is direct and in the subform's query table – including the button we want to program.
(This is my example but it wont stay in columns in this "post box" (sorry) )
IDNo App _ID App_Freq App_Date GetDates Action_Date
22 18 56 21-Jun-13 BUTTON 14-Jun-13
21 19 56 16-Aug-13 BUTTON 9-Aug-13
*
The GetDates Command BUTTON should generate the red data above, like:
Private Sub GetDates_Click()
Go to a new record
Go to the field App_Freq and fill it with:
Copy/paste the data from the field of the same name in the previous record
Go to the field App_Date and fill it with:
data based on this calculation using the PREVIOUS record fields: App_Date + App_Freq (which are days)
Go to the field Action_Date and fill it with:
data based on this calculation: App_Date (of current record now filled out - step above), minus 7 (days).
End Sub
That’s it!
All the dates’ format is set to medium date.
An error message should come up in case App_Freq is empty, for example…
Also note that the data can be manually changed at any time and should not revert to its last calculation. The button only generate data into a new record.
THANK YOU
I only know enough VBA to insert codes in the right place! Here is what we would like – in plain English. Can you “translate” in VBA?
It is a continuous subform (Names: Form = ClientUpdate / Subform = ClientUpdateSub. All of the data implicated here is direct and in the subform's query table – including the button we want to program.
(This is my example but it wont stay in columns in this "post box" (sorry) )
IDNo App _ID App_Freq App_Date GetDates Action_Date
22 18 56 21-Jun-13 BUTTON 14-Jun-13
21 19 56 16-Aug-13 BUTTON 9-Aug-13
*
The GetDates Command BUTTON should generate the red data above, like:
Private Sub GetDates_Click()
Go to a new record
Go to the field App_Freq and fill it with:
Copy/paste the data from the field of the same name in the previous record
Go to the field App_Date and fill it with:
data based on this calculation using the PREVIOUS record fields: App_Date + App_Freq (which are days)
Go to the field Action_Date and fill it with:
data based on this calculation: App_Date (of current record now filled out - step above), minus 7 (days).
End Sub
That’s it!
All the dates’ format is set to medium date.
An error message should come up in case App_Freq is empty, for example…
Also note that the data can be manually changed at any time and should not revert to its last calculation. The button only generate data into a new record.
THANK YOU
Last edited: