Change recordset from another form

J

Jonas Eriksson

Hi,

I've been struggling with this for a long time now. I thought it would be a
simple thing to do:

I'm programming an ADP ontop of a SQL Server db.

I have a form frmCustomers with a subform frmCustomersDetails , the subform
displays one customer - with the use of Recordset = "Customers" and
Serverfilter = "CustId = nnnn".

It seems very okay (no?) and works mostly well to navigate to a customer
with id nnn.

And I have another form frmSearch, from which the user can enter the
customer id and hit enter, and I try to set the
frmCustomerDetails.Serverfilter to change the displayed customer:

frmCustomers.frmCustomersDetails.Form.Serverfilter="
Serverfilter = "CustId = " & id
frmCustomers.frmCustomersDetails.Form.Requery

OK?

The thing is that - sometimes - this code just does nothing, the customer
isn't at all changed. I have seen that the serverfilter actually did change,
but the visible customer did not!

The frmCustomersDetail has 5 subforms (ordered on tabs).

I would love some response on this, it really drives me crazy... :)

--

Is there a difference on refferring to the subform in this two ways:

frmCustomers.frmCustomersDetails.Form.Recordset = ...

and

frmCustomersDetails.Recordset =...

?
 

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