Command Button Open Form Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I put a command button on to open another form. Access
asks what fields to use to match the forms. I checked at Do.cmd to see what
was being passed in the strLinkCriteria field and the ID number is correct.
However, when the other form is opened the field displays 0 instead of the
correct number. I don't understand this. Could someone explain to me what
happens between the Do.Cmd.OpenForm with the right LinkCriteria and the
opening of the other form and the ID is not what was passed?
Thanks,
RandyM
 
Any chance that the other form was already open in the background?
If it was, the criteria would not be applied.
 
Thanks Allen for the answer. Yes the other form is open, but why does that
matter? I'm still a novice at Access and am just struggling through it so
could you elaborate on why it matters?. Also, since it is open and since the
ID is not coming over through the 'link' that I thought Access had created
when it asked the fields to link on, what I should I do? And thanks again for
replying.

RandyM
 
When you OpenForm with criteria, the target form is opened filtered to a
specific value. It is opened with a filter--not with any kind of link to the
previous form.

It would be possible to use the Current event of the orignal form to change
the filter of the 2nd form, so that it appears synchronized. If you do this,
you will want to make one of the forms read-only so there is no chance of a
multi-user error. You will probably want to make sure that the read-only
form has not memo fields as well, since these can trigger the multi-user
error also.
 
Back
Top