filter a form without opeing it

  • Thread starter injanib via AccessMonster.com
  • Start date
I

injanib via AccessMonster.com

is it possible to edit a record with the event procedure of a control on a
form that is completely seperate from the source of the record if the source
of the record is not open?
for example, I have a form with only a textbox where I scan a barcode
(Tracking number). On enter it should filter another form, which is not open,
for that tracking number.
I was thinking about making the form a subform in the form where I scan the
barcode, but if I can do it without having to open the form I would rather do
that.
 
D

Douglas J. Steele

The idea of filtering a form without opening it doesn't make sense! Forms
are strictly windows into data stored in tables. What are you trying to
accomplish? In other words, what are you hoping that filtering an unopened
form will do for you?
 
I

injanib via AccessMonster.com

it does not have to be done on the form. if the filtering can be applied to
the record source of the form and there change the value of another field.
Here is what I want to acomplish.

I have a form called "Tracking" based on a table called "Tracking". two of
the fields in the table are "ItemNumber" and "Status". I use the form to log
incoming packages. Once the packages have been delivered I need to update the
status from originaly Undelivered to Delivered.

On the switchboard I have an option "Update package Stus" which takes me to
another form that has an unbound textbox. In the textbox I scan "ItemNumber"
which appears in barcode font on the report for the "Tracking". Once
"ItemNumber" is scaned I want the ON Enter property of the textbox to filter
the records in "Tracking" for that ItemNumber and then change the status
value from Undelivered to Delivered.
The idea of filtering a form without opening it doesn't make sense! Forms
are strictly windows into data stored in tables. What are you trying to
accomplish? In other words, what are you hoping that filtering an unopened
form will do for you?
is it possible to edit a record with the event procedure of a control on
a
[quoted text clipped - 10 lines]
 
D

Douglas J. Steele

Sounds like all you need do is run an Update query once you've scanned the
bar code.

No need to involve any other form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


injanib via AccessMonster.com said:
it does not have to be done on the form. if the filtering can be applied
to
the record source of the form and there change the value of another field.
Here is what I want to acomplish.

I have a form called "Tracking" based on a table called "Tracking". two of
the fields in the table are "ItemNumber" and "Status". I use the form to
log
incoming packages. Once the packages have been delivered I need to update
the
status from originaly Undelivered to Delivered.

On the switchboard I have an option "Update package Stus" which takes me
to
another form that has an unbound textbox. In the textbox I scan
"ItemNumber"
which appears in barcode font on the report for the "Tracking". Once
"ItemNumber" is scaned I want the ON Enter property of the textbox to
filter
the records in "Tracking" for that ItemNumber and then change the status
value from Undelivered to Delivered.
The idea of filtering a form without opening it doesn't make sense! Forms
are strictly windows into data stored in tables. What are you trying to
accomplish? In other words, what are you hoping that filtering an unopened
form will do for you?
is it possible to edit a record with the event procedure of a control
on
a
[quoted text clipped - 10 lines]
 
I

injanib via AccessMonster.com

I know how to creat an update query, but I don't know what to set the
criteria to and don't know how to un it from the form where I scan the
barcode. Can you please tell me how?
Sounds like all you need do is run an Update query once you've scanned the
bar code.

No need to involve any other form.
it does not have to be done on the form. if the filtering can be applied
to
[quoted text clipped - 29 lines]
 
D

Douglas J. Steele

It's a bit difficult without knowing the details of your application, but
assuming your bar code is being scanned into a text box name txtBarCode, in
the AfterUpdate event of that textbox, put code along the lines of:

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = '" & Me.txtBarCode & "'", dbFailOnError

End Sub

This assumes that ItemNumber is a text field.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


injanib via AccessMonster.com said:
I know how to creat an update query, but I don't know what to set the
criteria to and don't know how to un it from the form where I scan the
barcode. Can you please tell me how?
Sounds like all you need do is run an Update query once you've scanned the
bar code.

No need to involve any other form.
it does not have to be done on the form. if the filtering can be applied
to
[quoted text clipped - 29 lines]
 
I

injanib via AccessMonster.com

item number is a number field
It's a bit difficult without knowing the details of your application, but
assuming your bar code is being scanned into a text box name txtBarCode, in
the AfterUpdate event of that textbox, put code along the lines of:

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = '" & Me.txtBarCode & "'", dbFailOnError

End Sub

This assumes that ItemNumber is a text field.
I know how to creat an update query, but I don't know what to set the
criteria to and don't know how to un it from the form where I scan the
[quoted text clipped - 10 lines]
 
D

Douglas J. Steele

In that case,

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = " & Me.txtBarCode, dbFailOnError

End Sub


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


injanib via AccessMonster.com said:
item number is a number field
It's a bit difficult without knowing the details of your application, but
assuming your bar code is being scanned into a text box name txtBarCode,
in
the AfterUpdate event of that textbox, put code along the lines of:

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = '" & Me.txtBarCode & "'", dbFailOnError

End Sub

This assumes that ItemNumber is a text field.
I know how to creat an update query, but I don't know what to set the
criteria to and don't know how to un it from the form where I scan the
[quoted text clipped - 10 lines]
 
I

injanib via AccessMonster.com

This is beautiful. One last request. I have another unbound textbox
(txtRecipient) right below txtBarcode. I would like it to display the
Recipient corresponding to this item number from the same table.
In that case,

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = " & Me.txtBarCode, dbFailOnError

End Sub
item number is a number field
[quoted text clipped - 17 lines]
 
D

Douglas J. Steele

Difficult for me to say without knowing your table structure, but assuming
Recipient is a field in Tracking, probably something like:

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE Tracking SET Status = 'Delivered' " & _
"WHERE ItemNumber = " & Me.txtBarCode, dbFailOnError
Me.txtRecipient = DLookup("Recipient", "Tracking", _
"ItemNumber = " & Me.txtBarCode)

End Sub

(note that I corrected the update statement: there was a blank missing
between the table name and the keyword SET)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


injanib via AccessMonster.com said:
This is beautiful. One last request. I have another unbound textbox
(txtRecipient) right below txtBarcode. I would like it to display the
Recipient corresponding to this item number from the same table.
In that case,

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE TrackingSET Status = 'Delivered' " & _
"WHERE ItemNumber = " & Me.txtBarCode, dbFailOnError

End Sub
item number is a number field
[quoted text clipped - 17 lines]
 
I

injanib via AccessMonster.com

You Da man!
Difficult for me to say without knowing your table structure, but assuming
Recipient is a field in Tracking, probably something like:

Private Sub txtBarCode_AfterUpdate()

CurrentDb.Execute "UPDATE Tracking SET Status = 'Delivered' " & _
"WHERE ItemNumber = " & Me.txtBarCode, dbFailOnError
Me.txtRecipient = DLookup("Recipient", "Tracking", _
"ItemNumber = " & Me.txtBarCode)

End Sub

(note that I corrected the update statement: there was a blank missing
between the table name and the keyword SET)
This is beautiful. One last request. I have another unbound textbox
(txtRecipient) right below txtBarcode. I would like it to display the
[quoted text clipped - 14 lines]
 

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