Requery Simple Approach

J

Julius

Good day all, I need a simple approach to creating a requery. Here is my
situation. I have two forms using the same table. Neither form is a
subform. One form is called Update Open records, the seccond is called View
all closed records. Recently I put a checkbox called reopend with a date
field text box, on both forms. what I would like to do is when a checkmark
is put into the reopened checkbox on the View all closed records form, that
selected record needs to be transferred to the Update Open records form.
What is the cleanest way to do this. Can someone explain this to me as if I
was a four year old. Sometimes the responses given are more complex than the
problem. Please advise.
 
L

Lord Kelvan

you may have to be mroe clear we cannot see your screen so we dont
know what you are seeing i take it that the update open records form
displays a list of all open records and the closed records form
displays a list of all closed records and i supose beside each record
you have a tick box.

when you tick the box you want the record to no longer appear in the
closed records form but in the open records form but remain closed.

or do you want it to appear on both forms.

is the above what you are looking for?

as a note this question should be posted in the group

microsoft.public.access.forms

Regards
Kelvan
 
J

John Spencer

Are both forms open at the same time? Always?

Assuming that the underlying queries appropriately select records and
the forms are both open I would add a bit of code to the after Update
event of the forms.

If Me.CheckReopened = False then
Forms!UpDateOpen.Requery
End If

You should be aware that if you are working on a record in the
UpdateOpen form and have not saved the change, you could run into
errors. Also the records you have selected will change.

If you want to handle all that then, things get complex.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
J

Julius

In the after update even I have a macro in that spot that allows the date
field to populate once I put the tick mark in there so I am not sure where I
would put the below code. I don't believe the forms are open at the same
time. Which form would I put the code listed below. Oh and I put this
question here because I thought it was a requery issue for the query.
 
J

Julius

You hit the nail on the head that is exactly what I what I have. The only
thing is when the form is requery I no longer want to show it in the View all
Closed records. I want it to appear only in the Update Open records, and it
will keep its original closed date.
 
J

John Spencer

If the two forms are never open at the same time, then all you really
need to do is adjust the record source of the forms. Add criteria to
show records where the checkbox (assumption: you do have that checkbox
bound to a field in the table) is checked or not checked.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
L

Lord Kelvan

yeah as john said you need to create a field in the table which can be linked
to the check boxes so the query for the update open records form would be
what you have at current but also another condition which is

where newyesnofield = true

hope this helps

Regards
Kelvan
 

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