auto populate field when query run

  • Thread starter Thread starter twalsh
  • Start date Start date
T

twalsh

I have a ticketing system running in access. When an employee creates a
ticket the "Status" field is defaulted to "Pending"

Ticket workers click a cmdbutton that opens a form based on a query meant to
find the oldest "pending" ticket.

When this form is opened or query is run, i would like to set the "Status"
as "Working" so that the next ticket worker doesnt get the same ticket.

I would really prefer not to have the ticket workers manually change the
status and update.....
 
I have a ticketing system running in access. When an employee creates a
ticket the "Status" field is defaulted to "Pending"

Ticket workers click a cmdbutton that opens a form based on a query meant to
find the oldest "pending" ticket.

When this form is opened or query is run, i would like to set the "Status"
as "Working" so that the next ticket worker doesnt get the same ticket.

I would really prefer not to have the ticket workers manually change the
status and update.....

You could use the form's Current event with code like:

Private Sub Form_Current()
If Me!Status = "Pending" Or Me.NewRecord Then
Me!Status = "Working"
Me.Dirty = False ' force a save of the record
End If
End Sub

Unfortunately this will make a record "Working" even if you just LOOK at it...
that may not be what you want! Perhaps you need an update query in the command
button's code, or another button on the form that the user can click to
indicate that they have actively decided that they ARE "working" on this
particular record.
 
Back
Top