Refresh/Update subform

W

Woodies_46

Hi all i'm just having a little trouble.

What I have is a search form called [Searchfrm] with critera on it,
tick boxs and stuff. On this form I have a subform called {subsearch]
the feilds in this table are linked to a query. Down the bottom of the
the form I have a search button when click writes up a SQL and sends it

to the premade query which works great.


The trouble is when I go to refresh the subfrom[subsearch] on
[searchfrm] it dosn't update with the new information. It seems to
flash so it looks like it trying to refresh but the prevoiues values
stay there :(.


The only time I can get it to show me the corrrect results is if I
close and open the form agian .


Any help would be really apprectiated.


Thanks
 
M

Marshall Barton

What I have is a search form called [Searchfrm] with critera on it,
tick boxs and stuff. On this form I have a subform called {subsearch]
the feilds in this table are linked to a query. Down the bottom of the
the form I have a search button when click writes up a SQL and sends it
to the premade query which works great.

The trouble is when I go to refresh the subfrom[subsearch] on
[searchfrm] it dosn't update with the new information. It seems to
flash so it looks like it trying to refresh but the prevoiues values
stay there :(.

The only time I can get it to show me the corrrect results is if I
close and open the form agian .


Which form are you using to display the query's data, the
subform?

What does "sends it to the premade query" mean, set the
querdef's SQL property?

How are you "refreshing" the subform? If you are using:
Me.subsearch.Form.Requery
it should work.

I think you find it simpler all the way around if you just
write the SQL statement directly to the subform's
RecordSource property, instead of messing about with a
querydef and "refreshing".
Me.subsearch.Form.RecordSource = strSQL
 
W

Woodies_46

Which form are you using to display the query's data, the
subform? Yes
What does "sends it to the premade query" mean, set the
querdef's SQL property? Yes

Yes i'm am using the requery conmand but it doesn't work for some
reason.

I have already tried the reccordsource way but it doesn't do what i
want it to.

U see I had the requry thing working at one stage, if i opened up the
main form then opened up the query that was linked to the subfrom and
changed a few critera like the where statment then went back to the
main for and ran the requery command it worked fine, but when I chaned
it to automaticly generate the SQL it stoped updating. I don't know
why.
 
D

Duane Hookom

It seems I am replying to the same exact question from Woodies in another
news group (moduledaovba). Woodies actually posted the SQL that was built in
the code.

Woodies, please don't post to more than one news group. This is rarely
required and causes confusion and extra resources.
 
Top