Auto populating a field

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.....
 
P

Piet Linden

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 meantto
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 do it in the Open or Close event of the form.
Me.txtTicketStatus="Working"
 
J

Jack Leach

If your popup form will only ever be on one record, you can use the OnOpen
event, and use a command such as:

Me.ControlName = "Working" or
Me.ControlName = 1

If this is a navigatable form so users can move from record to record, take
a look at the on Current event. This event fires whenever the record is
changed (reflect the new record's data, not the record you're leaving). This
one is a bit tricker to use... because this event is fired on the form's
initial open as well, you need to have some good null handling here (search
help on the Nz() function, it will come in handy in this case).

As far as a query goes, users should only be editing record-by-record from
forms, so it shouldn't be much of a worry in this case. In the event that
you need to perform mass operations on this data, use an Update query to
change the value to Working.


hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
J

Jack Leach

wait wait wait... on open may not work here. I'm having a brain fart and
can't remember if there's an active record or not at that point. You may
have to use the Current event instead.


--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top