Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Question Unanswered: Save a form then making uneditable

    Is there a way to, once I hit my print button on my form and it prints the the report, it saves and then the data cannot be changed in the form??
    Gotta to do some code

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Yes, but you are going to have to give more details.

  3. #3
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Thumbs up

    I have a "Request for Work Order form" that salesmen fill out. Many times they have many requests for the same customer.

    When they are done they hit a print button. Then it returns them to the form they just printed. They just type over data in this same form (because it is easier for them) but I want them to enter the data in a new record. They should be able to review the data they just entered, but basically, they should not be able type over exsisting data.

    I am a little green when it comes to VBA code so go easy on me.

    I have noticed however, PracticalProgram you have really helped a number of people!! Myself included on other questions

    Thanks
    Gotta to do some code

  4. #4
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Are each of these "Request for Work Order" a new "Request for Work Order" with their own unique identification?

  5. #5
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Yes they are
    Gotta to do some code

  6. #6
    Join Date
    Feb 2004
    Posts
    137
    In the form's Code Module, paste the following code:

    Private Sub Command0_Click()
    ' Substitute Command0 with the actual name of the Print button

    DoCmd.OpenReport "Report", acNormal
    ' Substitute "Report" with the actual name of the report
    DoCmd.GoToRecord , , acNewRec

    End Sub

    Private Sub Form_Current()

    Me.AllowEdits = (Me.NewRecord = True)

    End Sub

    This will automatically position the form on a new record when the report is printed. This will also allow for viewing of all records, but only allow edits on new records.


    See if this works for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •