Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    User input idea required (2003)

    I have a command button on a form that runs an update query. The idea being, once the user has selected the invoices they wish to settle, they press the button and it is done.

    All update query really does is to change the settings of two check boxes and put a paid date into the PaidDate field of the table containing the data.

    However, I also need the user to enter a cheque number against the invoices that they are paying.

    I have this code so far, but the "qry05_PaymentList_UpdateChqNos", is just a select query I have done but I cannot update the underlying table.

    How can I do this and protect the source data from getting messed up by the users?

    Private Sub cmdSettle_Click()
    Select Case MsgBox("Are you sure you would like to proceed with the payment update?", vbYesNo)
    Case vbYes
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qry02_settlement", acViewNormal
    sfmPayList.Requery
    DoCmd.SetWarnings True
    MsgBox ("The invoices you selected have now been settled. Please update the cheque numbers."), vbInformation
    DoCmd.OpenQuery "qry05_PaymentList_UpdateChqNos", acViewNormal
    Case vbNo
    End Select
    End Sub


    Many thanks as always
    Hayden

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User input idea required (2003)

    First of all you have to review your query so it becomes an updatable query. Not seeing the query and not knowing your structure I can't say more.
    Then I should use a form to display the query and then you have control on what you want to allow the user to change. For example you could lock all the fields but cheque number.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User input idea required (2003)

    Thanks for the reply Francois, I think I understand what you mean I'll give it a try

    Rgds
    Hayden

  4. #4
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User input idea required (2003)

    Hi Francois

    I have tried to do what you suggested but I think I've messed it up.

    I managed to do an update query, but I can't get the query onto a form. I have attached a sample of the database I'm working on.

    Would you be able to help me by showing me what you mean?

    Kind Rgds
    Hayden

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: User input idea required (2003)

    Update and other action queries don't return rows, so you can't display them on a form, if that's what you're trying to do. Francois was talking about displaying a select query in a form.
    Charlotte

  6. #6
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User input idea required (2003)

    Hi Charlotte

    It's probably my explanation that is all muddled up. It's very difficult to ask the right questions with my limited knowledge of access so please forgive me.



    When invoices are received from suppliers during the month I want to record them in the db. The user can then select the invoices that are due for payment, say at the end of the month, pay them and record a cheque number against them. I've got the entry and the selection part ok, so what I'm trying to do, is some how to get the user to enter a cheque number against the invoices that have been paid.

    Rgds
    Hayden

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: User input idea required (2003)

    Right, so if you display the records with a paid date and no check number in a continuous form, the user can enter the check numbers there.
    Charlotte

  8. #8
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User input idea required (2003)

    Ah of course!
    Just tried it and it works.
    I can be so stupid sometimes !

    Many thanks
    Hayden

Posting Permissions

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