Is this possible to do?

vividor

Registered User.
Local time
Today, 17:08
Joined
Aug 5, 2002
Messages
31
I have a Form and at the bottom there is a command button to save the record and close the form.

What I want to do is to create a field on my table called "RptCompleted (Yes/No)", so when the user click on the command button it will trigger the field "RptCompleted" to switch to "yes".
You see, this field will work like a flag and use this information to track who has completed the report today.
Any body has any suggestions?
 
First off, make sure you have the RptCompleted column in your form's recordsource. If you are using the table as the recordsource (instead of a query) then you should be fine. Then add a checkbox control to your form and set the control source to the RptCompleted column. In you code, just before saving the record, assign the RptCompleted column value.

E.g. Me.RptCompleted = True

That's it. Once you have tested it to make sure it works the way you want then you may want to set the checkbox's visible property to false (unless you want the user to see it).

Hope this is what you wanted.
 
Schof, you suggestions is really close to my issue..
Let me give you more detail about this form.

The check box will be invisible to the user so the user do not need to check on it , also this field will be the last field on the form before jumping to the command button "Record Save" but I want the command button "Record Save" do the checking on the field "RptCompleted" before saving it and closing the form.

Why? Because there is another command button "Record in Process", so that means that if the user has not finish typing the data he/she can finish later but in the mean time the data will be save.

What I am trying to do is to keep track of the finish reports.
 
What I suggested should work just fine for you then. As an added precaution (in case the user accidentally clicks on the "Record Save" button instead of "Record in Process" button) I would set the RptCompleted field to false when the used clicks on the "Record in Process" button.

I imagine you will then use the RptCompleted field to create reports listing the "reports" that have (not) been completed, etc.
 
Schof, you are correct. I will create a report with the users that has completed their report.

Now, can you elaborate more on the instrution you gave me..

i already added a check box "RptCompleted", I conected column "RptCompleted" to the Row Source. What else?

Where I put this instruction, "Me.RptCompleted = True "
 
Last edited:
You need to put that in the command button event procedure, before the save command.

For example, if your button is called RECORD_SAVE_Button then in the command button properties you should have an event procedure defined for the On Click event. If you used the wizard to create the button then the code should look something like this...

Private Sub RECORD_SAVE_Button_Click()
On Error GoTo Err_RECORD_SAVE_Button_Click

Me.RptCompleted = True

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_RECORD_SAVE_Button_Click:
Exit Sub

Err_RECORD_SAVE_Button_Click:
msgBox Err.Description
Resume Exit_RECORD_SAVE_Button_Click

End Sub


I am attaching an example that shows exactly what it is you want to do.
 

Attachments

Schof, you are a good, just like Einstein..
this is exactly what I need. Thank You
 

Users who are viewing this thread

Back
Top Bottom