Automatically creating and updating a form record

jamiesuperman420

Registered User.
Local time
Yesterday, 21:37
Joined
Nov 20, 2008
Messages
43
Hey!! Hopefully you can help me!!

I have a database used to track property maintenance services. I use one form as a "main page" to display each property and what the services performed there (plus prices, etc, etc) are. Also on that page is a Notes form (shown as a datasheet) where notes such as "Increase in Fee" can be inputted, etc, etc. The Notes form has "Today's Date" "Effective Date" and "Note" for fields.

What I'm looking to do, is this: when someone updates, say, the day of the week we perform work at a property, I want a record to be created in the Notes field that says today's date and in the "Note" field something like, "Schedule changed." I know I should put the code in "After Update" but I'm not sure how to start the code to actually do it.

Any help would be greatly appreciated!! Thank you in advance.

Jamie S
 
I want a record to be created in the Notes field that says today's date and in the "Note" field something like, "Schedule changed."

Ok, so u want to put today's date in the notes field and "Schedule Changed, also in the notes field?
 
Effectively, yep. "Notes" has it's own form, so I BELIEVE I need to create a new record in that form, then fill-in the fields as desired. I just don't exactly know the code to do that :(
 
I'm not sure if you have a notes table. I'll assume you do.

Dim rs as New Adodb.Recordset
'SELECT zero records
rs.Open "SELECT * FROM Notes WHERE 1 = 0", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic
rs.AddNew 'adds new rec
rs("Note") = "Schedule Changed"
rs("theDate") = Date() 'today's date
rs.MoveFirst
rs.Close
set rs = nothing
Msgbox("A note was added.")


 
Jal;

Thank you very much for responding. I have a Notes table, yes. I inserted your code but receive a "Compile Error: Syntax Error" for:

rs.Open "SELECT * FROM Notes WHERE 1 = 0", CurrentProject.Connection,

I looked up stuff about rs.Open, but I can't say understand how it works, so here I am asking for your help again.

Thank you!!
 

Users who are viewing this thread

Back
Top Bottom