Is this possible?

  • Thread starter Thread starter Rick's News
  • Start date Start date
R

Rick's News

I want to have an unbound memo field that will update a table that is not
bound to the form...

The unbound form will have memos entered into it based upon a checkbox.
If the checkbox is check then that message is displayed the the unbound
field and then entered into the table by an Update button.

I can handle the unbound form = the checkboxes, but I can figure out the
syntax to update the unbound table...

Please Help, Thanks in advance!

-TSgt Laramee
 
Untested code, put in the Update button click event:

Dim rs as DAO.recordset 'define a DAO recordset

set rs = currentdb.openrecordset("tblMemos") 'set the recordset to your
table ( adjust
table name accordingly )

rs.add 'add a new record
rs!fldMemo = me.txtMemo 'set the field in the memo table to the text on your
form ( adjust field names to your own )
rs.update 'update the record with the new data

rs.close 'close the recordset

set rs = nothing 'destroy the reference

end sub

Watch the word wrap in your newsreader !



--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
How do I code it to update the right record? I use the SSN number in the
table to get the right personnel.

I have a table for personnel and a table for memos.

Thanks for taking time to help me.

-Rick
 
Hi,
Something like this:

Dim strSql As String
strSql = "Update tblMemos Set yourField = '" & _
Me.yourMemoField & "' WHERE SSN = " & Me.yourSSNControl

CurrentDb.Execute strSql,dbFailOnError

Substitute the correct field and control names.
 
Thank you so much!!!!


Dan Artuso said:
Hi,
Something like this:

Dim strSql As String
strSql = "Update tblMemos Set yourField = '" & _
Me.yourMemoField & "' WHERE SSN = " & Me.yourSSNControl

CurrentDb.Execute strSql,dbFailOnError

Substitute the correct field and control names.
 
I mis-read. I assumed you wanted to add a new record, not do an update.
But I see that Dan gave you a solution.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top