Linking calculations in a form to a table

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Guest
I have a table that includes a field called [Date Issued] and a field called [Expiry Date]. In my form I have a calculation that determines the [Expiry Date] from an input [Date Issued] using the DateAdd and IIf functions. However although the calcs work in the form - I can't get them to return the values to the table (the Date_Issued does return to the table). Any help would be appreciated
 
Hi Scott!
you should write the code in the OnClick event of the 'Save' button (u should create on ur form).
The code should be like this:
yourRecordset.Edit
ME.[ExpiryDate].setfocus
yourRecordset.Fields("urExpiredateSno")= Me.[ExpireDate]
Me.[IssuedDate].Setfocus
yourRecordset.Fields("urDateIssuedSno")=Me.[IssuedDate]
yourRecordset.update

try it !!
hope it will work
imran
 
Imran - thanks for info but I don't know much about VB macros.

I've set up a text box on form called [Expiry Date] and a command for[save] - I then put in your routine into OnClick event, but it didn't work.

I'm assuming 'yourRecordset' is the name of my table [Permit Details] and 'Me' is the name of my form [Permit Details2]. Is 'urExpiredateSno' my DateAdd function?

I don't know what 'urDateIssuedSno' is meant to be!

An idiots guide would be appreciated.
 

Users who are viewing this thread

Back
Top Bottom