| | |
Adding new records automatically in Access
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
OK, now this problem relates to the same one ive been having with the invoices, "Transfering records", that I posted.
If i have a text filed, lets say activity, which contains the user activity on a form, (Eg user clicks "Send Report" button and "activity" changes to "Report Sent" - this is basic and works OK) and a table for notes:
a - date/time - Date/Time
b - note - String
User - String
How can I add a record to the notes table if a user has caused the activity field to change. The event leading to the actual adding of the record i've got, but no more.
In the above eg for instance, the user clicked "Send Report" and activity changes to "Rerport Sent" i want the following record added to the Notes table:
Date/Time: Now() (Automatticaly by default Value)
Note: "Report Sent"
User: "System"
I cant seem to find a command that will enable me to add a record.
Ive managed to get the table/form to open in add mode, but the fields are not inserted automatically. I dont particularly like the table being opened, but if it works that 100%. The table then closed after the record has been added. This needs to be done in the back ground if possible, so that the user is not aware of the records.
Any ideas or directions???
Thanks,
J
If i have a text filed, lets say activity, which contains the user activity on a form, (Eg user clicks "Send Report" button and "activity" changes to "Report Sent" - this is basic and works OK) and a table for notes:
a - date/time - Date/Time
b - note - String
User - String
How can I add a record to the notes table if a user has caused the activity field to change. The event leading to the actual adding of the record i've got, but no more.
In the above eg for instance, the user clicked "Send Report" and activity changes to "Rerport Sent" i want the following record added to the Notes table:
Date/Time: Now() (Automatticaly by default Value)
Note: "Report Sent"
User: "System"
I cant seem to find a command that will enable me to add a record.
Ive managed to get the table/form to open in add mode, but the fields are not inserted automatically. I dont particularly like the table being opened, but if it works that 100%. The table then closed after the record has been added. This needs to be done in the back ground if possible, so that the user is not aware of the records.
Any ideas or directions???
Thanks,
J
Hi,
You don't have to open nor a form or a table, just in the commandbutton that sends the report or do other actions add this statment:
where txtAtv is the textbox that contains the activity.
You don't have to open nor a form or a table, just in the commandbutton that sends the report or do other actions add this statment:
DoCmd.RunSQL "INSERT INTO tblNotes ( NoteDate, NoteText, NoteUsr ) SELECT Now(), [Forms]![Form1]![txtAtv] , 'System'"where txtAtv is the textbox that contains the activity.
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
![]() |
Similar Threads
- Searching for records contained in access from VB (Visual Basic 4 / 5 / 6)
- Running a VB application with MS Access database (Visual Basic 4 / 5 / 6)
- MS Access vs. MySQL (MS Access and FileMaker Pro)
- Read Me:Access to any type of DB's possible (Visual Basic 4 / 5 / 6)
- Using VBA with Access (was: Please Help!!!) (Visual Basic 4 / 5 / 6)
- connecting and adding new records (VB.NET)
- Primary Key Issue (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Retrieving MS Access records to ListView control
- Next Thread: Generate Primary Key in VB / Delete Record Status
Views: 4158 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





