473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

forms/subforms with DAO ?

Hello.

How can I synchronize subforms content with current record in master form,
if both form and subform are based on DAO code ?
I assigned DAO recordset to forms by using QueryDef, on Load event.

Thanks...

Nov 13 '05 #1
8 3053
On Sun, 1 May 2005 18:30:58 +0200, "Zlatko Matić"
<zl***********@sb.t-com.hr> wrote:

You're making it too hard for yourself. Remember how that DAO
recordset was created in the first place: by running a querydef. So
assign that querydef to the form, and another one to the subform, and
use LinkMasterFields and LinkChildFields properties to link the two.
Refer to the Northwind sample application, Orders form, for an
example.

-Tom.

Hello.

How can I synchronize subforms content with current record in master form,
if both form and subform are based on DAO code ?
I assigned DAO recordset to forms by using QueryDef, on Load event.

Thanks...


Nov 13 '05 #2
Unfortunately, I can't do that, because, QueryDef is a saved pass-through
query. Pass-through query can't be Record Source of a subform...
Therefore I tried to do it programaticaly. It works, but I don't know how to
synchronize...

"Tom van Stiphout" <no*************@cox.net> je napisao u poruci interesnoj
grupi:3e********************************@4ax.com.. .
On Sun, 1 May 2005 18:30:58 +0200, "Zlatko Matić"
<zl***********@sb.t-com.hr> wrote:

You're making it too hard for yourself. Remember how that DAO
recordset was created in the first place: by running a querydef. So
assign that querydef to the form, and another one to the subform, and
use LinkMasterFields and LinkChildFields properties to link the two.
Refer to the Northwind sample application, Orders form, for an
example.

-Tom.

Hello.

How can I synchronize subforms content with current record in master form,
if both form and subform are based on DAO code ?
I assigned DAO recordset to forms by using QueryDef, on Load event.

Thanks...

Nov 13 '05 #3
Zlatko Matic wrote:
Unfortunately, I can't do that, because, QueryDef is a saved pass-through
query. Pass-through query can't be Record Source of a subform...
Therefore I tried to do it programaticaly. It works, but I don't know how to
synchronize...


One thing I've done in the past is have a regular querydef based on
PTQ. Say your PTQ against MS SQL/Oracle/whatever is ptqApples. Set up
a reguular querydef called qryApples which is simply Select * from
ptqApples.

I don't recall having tried it, but I would think this way you could
pass parameters and use child/parent fields to synchronize that way.
I've done something similar when I found Access 97 would not allow me to
export from a PTQ.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #4
Hello.
Thank you for your answer.
In fact that is exactly what I tried to accomplish. I have a complex
pass-through query, and then a regular select query that filtrates the
result of PTQ by start/end date criteria, for example...But, Access doesn't
allow to use it as record source of subforms, with or without linking
master/child fields...Somehow it knowsw that uderlying query is PTQ !?
Anyway, I successfully assigned recordsets to subforms and comboboxes by
standard module code yesterday and now I will try to synchronize it...A lot
of work, but I think that increased performance is a worthy goal :) Regular
JET queries on linked tables were very, very slow...
I am curious, when I nest a pass-through query inside a regular JET query
and for example just filtrate start/end date criteria, does JET first
retrieve all results from the server and then filtrates, or it can
comunicate with server so that server knows that results will be filtrated?

Bye!


"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> je napisao u poruci
interesnoj grupi:d5**********@coranto.ucs.mun.ca...
Zlatko Matic wrote:
Unfortunately, I can't do that, because, QueryDef is a saved pass-through
query. Pass-through query can't be Record Source of a subform...
Therefore I tried to do it programaticaly. It works, but I don't know how
to synchronize...


One thing I've done in the past is have a regular querydef based on PTQ.
Say your PTQ against MS SQL/Oracle/whatever is ptqApples. Set up a
reguular querydef called qryApples which is simply Select * from
ptqApples.

I don't recall having tried it, but I would think this way you could pass
parameters and use child/parent fields to synchronize that way. I've done
something similar when I found Access 97 would not allow me to export from
a PTQ.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #5
Zlatko Matic wrote:
In fact that is exactly what I tried to accomplish. I have a complex
pass-through query, and then a regular select query that filtrates the
result of PTQ by start/end date criteria, for example...But, Access doesn't
allow to use it as record source of subforms, with or without linking
master/child fields...Somehow it knowsw that uderlying query is PTQ !?
That's weird. I use PTQs as recordsources for subforms all the time.
Usually in datasheet format. What I don't think I've done is have a
master/child field set up for them.
I am curious, when I nest a pass-through query inside a regular JET query
and for example just filtrate start/end date criteria, does JET first
retrieve all results from the server and then filtrates, or it can
comunicate with server so that server knows that results will be filtrated?


Good question. In my arrangements as described above, I frequently
hasve pop up menus using standard Access sort and filter menu choices.
I've never really given it great thought, but I always assumed that the
basic recordset is returned as per a pass through query and then
processed with an order by and/or filter using Jet. One of the big
pains with Oracle long data types (memo field) is that it can't be
searched. I get around this by using filters and Access search once the
PTQ is tailored as much as possible before getting into the long data type.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #6
Hello, Tim.

You were right, that was my mistake. I didn't left linking master/child
fields....
Now when I left linking properties, it should work, but still I have a
problem with deeper hierarchy levels of subforms. Only first two or three
levels are successfuly queried and displayed, while deeper subforms are
not... An error apears which indicates that the problem is something about
ODBC driver manager.
What is your suggestion ? Cache?

Bye.

"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> je napisao u poruci
interesnoj grupi:d5**********@coranto.ucs.mun.ca...
Zlatko Matic wrote:
In fact that is exactly what I tried to accomplish. I have a complex
pass-through query, and then a regular select query that filtrates the
result of PTQ by start/end date criteria, for example...But, Access
doesn't allow to use it as record source of subforms, with or without
linking master/child fields...Somehow it knowsw that uderlying query is
PTQ !?


That's weird. I use PTQs as recordsources for subforms all the time.
Usually in datasheet format. What I don't think I've done is have a
master/child field set up for them.
I am curious, when I nest a pass-through query inside a regular JET query
and for example just filtrate start/end date criteria, does JET first
retrieve all results from the server and then filtrates, or it can
comunicate with server so that server knows that results will be
filtrated?


Good question. In my arrangements as described above, I frequently hasve
pop up menus using standard Access sort and filter menu choices. I've
never really given it great thought, but I always assumed that the basic
recordset is returned as per a pass through query and then processed with
an order by and/or filter using Jet. One of the big pains with Oracle
long data types (memo field) is that it can't be searched. I get around
this by using filters and Access search once the PTQ is tailored as much
as possible before getting into the long data type.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #7
Well, I was playing all the afternoon and found that it works if I remove
all parameter (criteria) from the query. If I put any criteria, Access
realizes that underlying query is a pass-through query and then an error
apears. Therofore I must remove all criteria, for example start and end date
criteria.
I know how to programatically synchronize subforms with master forms, by
putting FindFirst on current event of master forms, but it will not be
enough because I have to filter data..So, how can I filter data in such
subforms ? Is there any way for filtering such recordset ? MAybe to clone
recordset and filter cloned recordset ?
I know that there is Filter property of ADO recordset, but I think that
there is no Filter property for DAO recordset (?). If that is true, is it
maybe possible to have a mixed DAO/ADO situation, for example to use DAO to
create a recordset from pass-through query and than filtrate somehow by ADO
?

Greetings,

Zlatko

"Zlatko Matic" <zl***********@sb.t-com.hr> je napisao u poruci interesnoj
grupi:d5**********@ss405.t-com.hr...
Hello, Tim.

You were right, that was my mistake. I didn't left linking master/child
fields....
Now when I left linking properties, it should work, but still I have a
problem with deeper hierarchy levels of subforms. Only first two or three
levels are successfuly queried and displayed, while deeper subforms are
not... An error apears which indicates that the problem is something about
ODBC driver manager.
What is your suggestion ? Cache?

Bye.

"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> je napisao u poruci
interesnoj grupi:d5**********@coranto.ucs.mun.ca...
Zlatko Matic wrote:
In fact that is exactly what I tried to accomplish. I have a complex
pass-through query, and then a regular select query that filtrates the
result of PTQ by start/end date criteria, for example...But, Access
doesn't allow to use it as record source of subforms, with or without
linking master/child fields...Somehow it knowsw that uderlying query is
PTQ !?


That's weird. I use PTQs as recordsources for subforms all the time.
Usually in datasheet format. What I don't think I've done is have a
master/child field set up for them.
I am curious, when I nest a pass-through query inside a regular JET
query and for example just filtrate start/end date criteria, does JET
first retrieve all results from the server and then filtrates, or it can
comunicate with server so that server knows that results will be
filtrated?


Good question. In my arrangements as described above, I frequently hasve
pop up menus using standard Access sort and filter menu choices. I've
never really given it great thought, but I always assumed that the basic
recordset is returned as per a pass through query and then processed with
an order by and/or filter using Jet. One of the big pains with Oracle
long data types (memo field) is that it can't be searched. I get around
this by using filters and Access search once the PTQ is tailored as much
as possible before getting into the long data type.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me


Nov 13 '05 #8
Well, I was playing all the afternoon and found that it works if I remove
all parameter (criteria) from the query. If I put any criteria, Access
realizes that underlying query is a pass-through query and then an error
apears. Therofore I must remove all criteria, for example start and end date
criteria.
I know how to programatically synchronize subforms with master forms, by
putting FindFirst on current event of master forms, but it will not be
enough because I have to filter data..So, how can I filter data in such
subforms ? Is there any way for filtering such recordset ? MAybe to clone
recordset and filter cloned recordset ?
I know that there is Filter property of ADO recordset, but I think that
there is no Filter property for DAO recordset (?). If that is true, is it
maybe possible to have a mixed DAO/ADO situation, for example to use DAO to
create a recordset from pass-through query and than filtrate somehow by ADO
?

Greetings,

Zlatko

"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> je napisao u poruci
interesnoj grupi:d5**********@coranto.ucs.mun.ca...
Zlatko Matic wrote:
In fact that is exactly what I tried to accomplish. I have a complex
pass-through query, and then a regular select query that filtrates the
result of PTQ by start/end date criteria, for example...But, Access
doesn't allow to use it as record source of subforms, with or without
linking master/child fields...Somehow it knowsw that uderlying query is
PTQ !?


That's weird. I use PTQs as recordsources for subforms all the time.
Usually in datasheet format. What I don't think I've done is have a
master/child field set up for them.
I am curious, when I nest a pass-through query inside a regular JET query
and for example just filtrate start/end date criteria, does JET first
retrieve all results from the server and then filtrates, or it can
comunicate with server so that server knows that results will be
filtrated?


Good question. In my arrangements as described above, I frequently hasve
pop up menus using standard Access sort and filter menu choices. I've
never really given it great thought, but I always assumed that the basic
recordset is returned as per a pass through query and then processed with
an order by and/or filter using Jet. One of the big pains with Oracle
long data types (memo field) is that it can't be searched. I get around
this by using filters and Access search once the PTQ is tailored as much
as possible before getting into the long data type.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Mudd | last post by:
I come from the Access environment where all the windows form handles were hidden so pardon my question. In Access I could make "continuous" subforms and there was a subform "container" object I...
25
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
3
by: godber | last post by:
I am having difficulty in adding a subform into my existing form, I have designed very simply databases in the past & this is my first attempt at compiling subforms - with little success I may add....
1
by: chris vettese | last post by:
I'm looking for advice on how to perform calculations on my forms. Iwill try to explain the situation as clearly as possible. I have a form that has multiple sub-forms. Some of these sub-forms...
4
by: Luisa Lopes | last post by:
Dear colleagues: I read somewhere that you could obtain the results of a query as a form. I have design a database for my books and waht I would like is to obtain the results of my queries...
4
by: sparks | last post by:
OK we have it so we can use tables to define skip patterns on our forms. BUT we can only do one form. Public Function skipPattern(currentFrm As Form, Optional currentCtl As Control = Null) As...
1
by: santociabattari | last post by:
Hi Folks, I have 3 forms I want to link, so that when I advance 1 record in one form it will update the other two with the same record in the first form. I have tried using the form wizard (I...
11
by: elaina | last post by:
Hello again. I have setup a master form linked to a subform (actually nested subforms, but the top level subform is the one giving me trouble.) When entering data, the forms all appear to work...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.