How to get requeried main form to keep subform in same place

D

doyle60

I have a subform on a main form that runs long, 100 or so records.
Users click records they want to show up in a report.

But after each click, I need to update the main form data, a response
to that click.

But if the user clicks record 88, a scroll down, the sub, because the
form is being requeried on each click, jumps to the top. Therefore
pressing line 92, 93, and 94 becomes a real hassle. After each click,
the form jumps to the top, making the next choice out of view.

I wish I could have a command button that updates the data after all
selections and not after each. But in this case, I really need to
update after each click.

How do I get the sub to stay in the same place?

Thanks,

Matt
 
G

Guest

You could use the DblClick event to do the actual update and have the single
Click event store the value of the RecordID of the Record you are clicking on
in a Global Variable and then set the sub form to select that variable after
refresh...
 
D

doyle60

I can't quite do what you suggest. But I could do this: What I'm
trying to do enable or disenable a option group button if the records
checked in a sub equal 0 or if the records checked in a sub equal the
total. If the records checked equal the total, I do not want the "Show
Unchecked" option to be active. If the records checked equal 0, I do
not what the "Show Checked" option to be active. They produce errors
if a users hits them when they are null.

So I have the following code in the Check box called PrintIt, with two
textboxes in the footer of the sub that add up the number of records
(PrintItTotal) and another that adds up the ones checked
(PrintItChecked). The trouble is this: the PrintItChecked only updates
if I go from one record to the next, it does not update after I click
it. So it does add it up correctly but not after the click. The
following code is in the AfterUpdate property:

Me.PrintItChecked.Requery
Me.PrintItTotal.Requery

If PrintItTotal = PrintItChecked Then
Forms!TVsfrm!Unchecked.Enabled = False
Else
Forms!TVsfrm!Unchecked.Enabled = True
End If

If PrintItChecked = 0 Then
Forms!TVsfrm!Checked.Enabled = False
Else
Forms!TVsfrm!Checked.Enabled = True
End If

I put the requery section in many Event Properties of the sub but the
text box in the footer (PrintItChecked) just won't requery and show the
right number. It only does, as stated, when going to another record.

Well, the idea here is I have an option group with three choices: Show
All, Show Checked, Show Unchecked. I cannot allow the Show Checked or
Show Unchecked to be enabled if they would produce nulls. It causes an
error (because I'm working with photographs and all).

Anyway, I had it working one way, but, as stated, it jumps the subform
too annoyingly.

Thanks,

Matt
 
D

doyle60

The errors that occured on nulls don't seem to occur anymore. I do not
seem to need the answer to this question any longer.

Thanks,

Matt
 

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