473,473 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form Data Source

RLN


I have 4 queries and all 4 queries use different tables and pull
different columns.

Is it possible to have one Generic all Purpose form (frmGeneral) and on
the fly at run time set frmGeneral's data source to any of these
queries:
qry1, qry2, qry3 or qry 4 before showing the form to the user?

Once the form is loaded and in view, can the data source be switched on
the fly if the users elects to see the results of another query? I
tried this but when designing the new form the next step was to drag
fields on to the form. I don't want to do this. I just want to change
data sources on the fly.

My whole reason for this is to cut down on maintenance and only have to
maintain one form instead of four near-duplicate-in-appearance forms.

Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Jul 3 '08 #1
10 1869
You can set the recordsource (any of your queries) in the open event of the
form with:
Select Case DecidingFactorForWhichQuery
Case Factor1 Value
Me.Recordsource = "NameOfQuery1"
Case Factor2 Value
Me.Recordsource = "NameOfQuery2"

etc ....
End Select

Then set the controlsource of controls on your form with:
Select Case DecidingFactorForWhichQuery
Case Factor1 Value
Me!Field1.ControlSource = "NameOfQueryField1"
Me!Field2.ControlSource = "NameOfQueryField2"
Me!Field3.ControlSource = "" ' Does not use field on form
Case Factor2 Value
Me!Field1.ControlSource = "" ' Does not use field on form
Me!Field2.ControlSource = "" ' Does not use field on form
Me!Field3.ControlSource = "NameOfQueryField3"
Me!Field4.ControlSource = "NameOfQueryField4"

etc ....
End Select

Steve
"RLN" <no*******@devdex.comwrote in message
news:12**************@news.newsfeeds.com...
>

I have 4 queries and all 4 queries use different tables and pull
different columns.

Is it possible to have one Generic all Purpose form (frmGeneral) and on
the fly at run time set frmGeneral's data source to any of these
queries:
qry1, qry2, qry3 or qry 4 before showing the form to the user?

Once the form is loaded and in view, can the data source be switched on
the fly if the users elects to see the results of another query? I
tried this but when designing the new form the next step was to drag
fields on to the form. I don't want to do this. I just want to change
data sources on the fly.

My whole reason for this is to cut down on maintenance and only have to
maintain one form instead of four near-duplicate-in-appearance forms.

Thanks.
*** Sent via Developersdex http://www.developersdex.com ***

Jul 3 '08 #2

"Mark" <no***@email.comschreef in bericht news:xL******************************@earthlink.co m...
You can set the recordsource (any of your queries) in the open event of the
form with:
Select Case DecidingFactorForWhichQuery
Case Factor1 Value
Me.Recordsource = "NameOfQuery1"
Case Factor2 Value
Me.Recordsource = "NameOfQuery2"

etc ....
End Select

Then set the controlsource of controls on your form with:
Select Case DecidingFactorForWhichQuery
Case Factor1 Value
Me!Field1.ControlSource = "NameOfQueryField1"
Me!Field2.ControlSource = "NameOfQueryField2"
Me!Field3.ControlSource = "" ' Does not use field on form
Case Factor2 Value
Me!Field1.ControlSource = "" ' Does not use field on form
Me!Field2.ControlSource = "" ' Does not use field on form
Me!Field3.ControlSource = "NameOfQueryField3"
Me!Field4.ControlSource = "NameOfQueryField4"

etc ....
End Select

Steve

--
Hey Mark/Steve!! We don't need you here !!
Hey Mark/Steve!! We don't want you here !!

This is to inform 'newbees' here about PCD' Steve:
http://home.tiscali.nl/arracom/whoissteve.html (updated, mainly the 'abuse-reporting' page...)
Until now 5850+ pageloads, 3675+ first-time visitors
(these figures are real and rapidly increasing)

Why is this ???
Because Steve is the ONLY person here who continues to advertise in the groups.

It is not relevant whether he advertised in *this* particular post or not...
==We want him to know that these groups are *not* his private hunting grounds!

For those who don't like too see all these messages:
==Simply killfile 'StopThisAdvertising'.
Newbees will still see this warning-message.

ArnoR
Jul 3 '08 #3
And, of course, if you need to do any type of data validation or manipulation
in the controls' AfterUpdate events or the form's BeforeUpdate event, you'll
have to qualify these as well by identifying which record source is currently
being used.

I've got to tell you, long term, I think you'll find that you're going to
increase your time spent on maintenance, not decrease it.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200807/1

Jul 4 '08 #4
RLN

Thank you for your code sample here, Mark. I appreciate it.

RLN
*** Sent via Developersdex http://www.developersdex.com ***
Jul 8 '08 #5
You know, I think this idiot posted and answered his own question
under two alias's. Probably trying to build credibility. That was not
even half an answer to the question.

I read the page on this numbnut. Where is this idiot from anyway?

The Frog
Jul 9 '08 #6
"The Frog" <Mr************@googlemail.comwrote in message
news:d2**********************************@27g2000h sf.googlegroups.com...
You know, I think this idiot posted and answered his own question
under two alias's. Probably trying to build credibility. That was not
even half an answer to the question.
Wouldn't be the first time.
>
I read the page on this numbnut. Where is this idiot from anyway?
Google PC Datasheet. His web site is hilarious. "Tricks and Tips" have
been "coming soon" for about 5 years and one listed "qualification" is
"large selection of reference books".

Keith.

Jul 9 '08 #7
Hi Keith,

Yeah, the idiots website is a laugh. Its like some high school project
on 'What should your business look like'. I love the fact that the
'reference' named Geordie has no company or last name, or details of
any work done. This is just a fool with an ego bigger than its
abilities.

PA - is that Pennsylvania (hope I spelled it correctly)? Thats where
the company seems to be registered / operates from. I wonder what
types of rules and regulations they have about spamming? It (the
idiot) seems to want public exposure - perhaps it should have it!

Cheers

The Frog
Jul 10 '08 #8
TTBOMK, I was the first CDMA regular to clash with Steve. I criticized him
harshly.
Did this change Steve? No!
Did this diminish me? I believe that it did.

Perhaps, CDMA could have benefitted if I had been able to find a gentle way
to encourage and help Steve. I’m pretty sure I’d feel better about the
interchanges now if I had made a strong effort to do that.

The Frog <Mr************@googlemail.comwrote in news:f9f7819f-5cc8-494d-
8f***************@t54g2000hsg.googlegroups.com:
Hi Keith,

Yeah, the idiots website is a laugh. Its like some high school project
on 'What should your business look like'. I love the fact that the
'reference' named Geordie has no company or last name, or details of
any work done. This is just a fool with an ego bigger than its
abilities.

PA - is that Pennsylvania (hope I spelled it correctly)? Thats where
the company seems to be registered / operates from. I wonder what
types of rules and regulations they have about spamming? It (the
idiot) seems to want public exposure - perhaps it should have it!

Cheers

The Frog
Jul 10 '08 #9
I hear what you are saying Lyle, and the sentiment is a good one. I am
all for people wanting to better themselves, and like you (although
not to nearly the same extent due to my limited experience) I try and
offer help through here to others.

I dont see 'Steve' doing this however. Maybe I am wrong, but I see
'phishing' taking place. Its sort of a 'Have a taste, I'm so
great....' rubbish followed with a 'oh, well, what do you know, I
guess I can answer that and help you out for "reasonable rates"'. To
me, thats just not in the spirit of helping others and sharing
knowledge. Perhaps this is why others are upset with him as well.

I dont mind if someone wants to genuinely contribute or learn, I am
happy to share what I have, and I benefit from the experience of
others in this group. I have learned much from here and as a result
the quality of my work has greatly improved. I for one am always
grateful for the advice of experienced others such as yourself, and
the other MVP's here, and of course SALAD!

This is not the case with the behaviour 'Steve' is demonstrating -
what he does masquerades as this, but it is by no means selfless and
seems motivated either to be cruel to the people asking questions or a
deceptive and smart-arsed form solicitation. Maybe I am wrong here,
but I call it how I see it.

Perhaps you are right, perhaps a gentler approach would be a better
way to go. I cannot however imagine that the result would be any
different than what you have already experienced because there is a
distinct lack of respect for anyone or anything except 'Steve's' own
private motivations.

Still, to play the victim here would be narcissistic. I for one will
simply watch the events unfold and enjoy the show. Perhaps I will even
take on the persona of one of those wonderful hecklers from 'The
Muppet Show' :-)

Cheers

The Frog
Jul 11 '08 #10

"The Frog" <Mr************@googlemail.comschreef in bericht news:43**********************************@x41g2000 hsb.googlegroups.com...
>I hear what you are saying Lyle, and the sentiment is a good one. I am
all for people wanting to better themselves, and like you (although
not to nearly the same extent due to my limited experience) I try and
offer help through here to others.
Lyle has on several occasions initiated a 'different', 'gentler' route...
Check out the thread "Healing' for instance.
Unfortunately even that did not work...
I dont see 'Steve' doing this however. Maybe I am wrong, but I see
'phishing' taking place. Its sort of a 'Have a taste, I'm so
great....' rubbish followed with a 'oh, well, what do you know, I
guess I can answer that and help you out for "reasonable rates"'. To
me, thats just not in the spirit of helping others and sharing
knowledge. Perhaps this is why others are upset with him as well.
Steve is not here to contribute, he is only here to 'fish' indeed.
He considers the groups as his private hunting-grounds
He even thinks he has the right to advertise, because he also answers some questions here.
I dont mind if someone wants to genuinely contribute or learn, I am
happy to share what I have, and I benefit from the experience of
others in this group. I have learned much from here and as a result
the quality of my work has greatly improved. I for one am always
grateful for the advice of experienced others such as yourself, and
the other MVP's here, and of course SALAD!

This is not the case with the behaviour 'Steve' is demonstrating -
what he does masquerades as this, but it is by no means selfless and
seems motivated either to be cruel to the people asking questions or a
deceptive and smart-arsed form solicitation. Maybe I am wrong here,
but I call it how I see it.
You are not at all wrong. You are 100% right.
Perhaps you are right, perhaps a gentler approach would be a better
way to go. I cannot however imagine that the result would be any
different than what you have already experienced because there is a
distinct lack of respect for anyone or anything except 'Steve's' own
private motivations.
We have tried gentle approaches several times.
Over the years it seems that *nothing* works to change Steve's attitude.
But he has been away several (long) times from the groups ==no advertising
Why has he been away ??
Because of the website ?? hmmm...maybe
Because of complaints to his ISP ?? Probably yes
I think so because he has changed from ISP several times (earthlink >supernews >giganews)

So what's left IMO is to try to get him out of here again; it is sad but true.
So: please complain to
ab***@giganews.com (appropriate action will follow when there are enough complaints)
Still, to play the victim here would be narcissistic. I for one will
simply watch the events unfold and enjoy the show. Perhaps I will even
take on the persona of one of those wonderful hecklers from 'The
Muppet Show' :-)

Cheers

The Frog
More to come ?? We'll see

Arno R
Jul 11 '08 #11

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

Similar topics

2
by: Paul | last post by:
I've searched this site for a few hours without a solution to my problem. Please help~ In short, the controls on my form have vanished. I can see nothing but a gray screen and grayed out navigator...
18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
7
by: | last post by:
I am having trouble figuring out to call a database INSERT procedure from a simple submit form. It appears I should use the onclick event to trigger the procedure called BUT when I do this I...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
0
by: Wayne Smith | last post by:
I've taken the following code from a developers web site which should allow a user to register and receive an email message with a link to activate their account, but when I click the link on my...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
8
by: Randy | last post by:
I have a form with 36 text boxes on it. I have everything working for the user to make changes to existing records or to add new ones. When I come to the point of passing this data on to the data...
6
by: smk17 | last post by:
I've spent the last few minutes searching for this question and I found an answer, but it wasn't quite what the client wanted. I have a simple online form where the user needs to fill out five...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.