||Re: VARIABLE DECLARATION
Mervyn Bick <email@example.com>
||Tue, 17 Apr 2018 09:13:51 +0200
On 2018-04-16 9:39 PM, MUSTANSIR GHOR wrote:
> Dear Mervyn
> Thank you for detail reply. May God bless you. I hope you feeling well.
I'm getting better thank you but I still can't spend as much time as I'd
like in front of the computer.
> The between form and data objects are very clear. Thanks once again.
> However I will keep on asking , I am sorry but you are our Doctor.
It's not a good idea to direct messages at specific persons. This is a
general forum where many people provide help. There are, in fact, MANY
people using the newsgroup who are better dBASE programmers than I am.
Generally speaking though, most of them are busy earning a living and
don't have too much time to spend on the newsgroups. I'm retired with
more time available so I can usually spend more time writing longer,
perhaps more detailed, messages when the topic is something with which I
> I have a set of radiobuttons. Each button selection needs to assigns a datasource property of a combobox to a table field NAME based of radio button selection. Although these tables (for each radio button) are different but their field structures are same.
> The confusion is do i need to create for all 5 tables , 5 queries in the constructor code at begining of class and assign at radio but event appropiate rowset.fields["NAME"] to datasource of cbitem
> I create query here (of course I worder this query will not be associated with form) and assign it to datasource property of cbitem. Will this work because query created here will vanish at the of event.
> The difference in both in my opinion is 1st one takes up more memory than 2nd one.
Ken has already given you an example. (He's awake while I'm asleep and
vice versa. :-) )
With modern computers lack of memory is seldom a problem. The second
option is, however, the better one anyway.
If you create the query by dragging the table onto the form in the
designer it's rowset will automatically be assigned to the form's rowset
property. This is usually the first line of code after all the
If you create five queries you can use the radiobuttons' onChange event
handler to assign the selected query's rowset to the form's rowset
property. The big problem here though is that you also have to change
ever datalink in the form.
If you look at Ken's code the datalink to the entryfield stays as
form.table11..... even when a different table is accessed. The query
is named table11 because Ken happened to drag table1 to the designer
when he created the form. Ken's form only has one datalink so changing
it when a new query is assigned to the form wouldn't be a problem but if
you had, say, 20 datalinks on a form this would be a pain.