-
Two queries
Hi,
I am on a access form. Is there any ways by which if i press the button, the data gets added to the table and the data entered in the form gets on to outlook (via sendobject)....in one go...
i mean how to make these things in one single query?
Regards,
T
-
Originally Posted by Tajinderp
Hi,
I am on a access form. Is there any ways by which if i press the button, the data gets added to the table and the data entered in the form gets on to outlook (via sendobject)....in one go...
i mean how to make these things in one single query?
Regards,
T
T,
In the On click event of a command button try something like this:
Code:
' Save the record if needed
If Me.Dirty Then Me.Dirty = False
' Send
Docmd.SendObject ...
You will need to enter the desired parameter for the SendObject
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
-
thanks for replying
so if i have a table attached to the form...which says table 1...how will i be able to save the data in that one?
right now my code says...
Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
DoCmd.GoToRecord , , acNewRec
Exit_Save_Record_Click:
Exit Sub
Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click
End Sub
Due to this code, i get to save data and move to the next record...or u can say addrecord....
how to make things work with this one...
-
By default, Access saves a record as soon as you navigate away.
If all you wan to do is save the record then use the code I posted previously like this:
Code:
Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
' Save the record if needed
If Me.Dirty Then Me.Dirty = False
Exit_Save_Record_Click:
Exit Sub
Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click
End Sub
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
-
thanks sir...and where do i adjust the sendobject in this code?
-
If you only want it to send when a record has been saved/updated then I would use the Form's After Update Event to run the Docmd.SendObject. This way it only sends after a successful save.
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
-
i did that....thanks sir...
-
Boyd Trimmell aka HiTech Coach
Microsoft MVP - Access Expert
[SIGPIC][/SIGPIC]
Office Programming 25+ years as a Software Developer specializing in:
Business Process Management
Accounting/Inventory Control
Customer Relations Management (CRM)
Electronic Data Interchange (EDI)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|