Is this possible?

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
 
A

Adrian Jansen

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
 
R

Rick's News

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
 
D

Dan Artuso

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.
 
R

Rick's News

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.
 
A

Adrian Jansen

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
 

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