On 10 Mar 2006 22:42:29 -0800, "Hansen" <helgardh@hotmail.com> wrote:
[color=blue]
>Hi Torque
>
>Is there a button on your form to write the values entered to the
>table? If not, I suggest that you put one on the form and add the
>record using the on click event of the button:
>
>Example:
>
>Dim dbs as DataBase
>Dim rst as RecordSet
>Dim qry as String
>
>Set dbs = opendatabase()
>qry = "Tablewheredatashouldbeadded"
>set rst = dbs.openrecordset(qry, dbopendynaset)
>With rst
> .Addnew
> !fieldnameintable = total.value
> !fieldnameintable2 = textbox2.value ...etc
> .Update
> .close
>End with[/color]
************************************************** **
Hello again Hansen,
I have tried adding a button with the save record command, gone into the OnClick Event properties, this is what is there;
Private Sub Command153_Click()
On Error GoTo Err_Command153_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Command153_Click:
Exit Sub
Err_Command153_Click:
MsgBox Err.Description
Resume Exit_Command153_Click
End Sub
I have tried many different variations of the example you gave me above and many times came up with errors. At times a lg box pops up
asking for a db or something. Other times no errors after clicking on the save button, but it does not record into table.
Maybe some info may help here.
my db name is newdb
the form im working in is named Table1
the table name is Table1
the 2 fields in particular im trying to record to Table1 are named, TripPay and TotalReimbursements
Im not real sure how to insert the info that you gave me above into the vb code screen.
If you want an idea of what im working with, I have posted 2 pics at this web address
http://home.carolina.rr.com/pcmed/
I have played around with access much in the past, but never had any instructions or help with it till lately.
I purchased a Training CD for Microsoft Access 2003 from
http://www.vtc.com/. While this CD has been
very helpful, it is still not giving me some information that I am looking for. I do not work with Access on a
Professional Level, It's more for Personal fulfillment. I enjoy designing applications to help me in my
job field.
Thanks for your correspondence
Robert