G
George
Hi to everybody,
I have been disappointed after having tried for so long to get an answer to
this question but I will give it a last try.
I am trying to learn object oriented programming and for this purpose I
decided to redesign an existing application using exclusively unbound forms.
(I stress this fact because in my previously posted questions, well-meaning
friends on this site have suggested easier ways to get my job done using
bound forms, but this is not what I want.)
I have an unbound form, frmClients, with text boxes, and combo boxes on it.
The form is based on table tblClients and class clsClient. At the bottom of
the form I have placed navigation, edit, add and delete buttons with code
behind them. So far I have managed to make everything work as expected except
one thing.
I don’t know how to deal with the combo boxes. For example, in my previous
corresponding bound form I had cboNationality which was using the look up
table tlkpNationalities [ NationalityID (long), Nationality (string) ] as its
row source to pick up its values. Now, through the code I have written I have
succeeded to pass the NationalityID field value from my table to the combo
box (I have checked on this) but nothing is displayed (naturally) as the
combo’s row source is left blank. I want the combo box to be completely
ignorant of the database’s tables and queries (as it should be in oop) and
that’s why I have left it blank.
How can I make cboNationality functional again on my currently unbound form,
provided that I leave its row source blank?
A. Do I have to create another class, clsNationality, and initialize it in
the initialize event of my clsClient and then proceed from there?
B. Do I need to add code that queries tlkpNationalities in my Let and Get
procedures of the private variable for the nationality or what?
I am totally in the dark and stuck for so long! I would appreciate any help
with practical advice. I have never used class modules before and the various
textbooks don’t cover this issue at all, they only deal with textboxes.
Thanks in advance, George
I have been disappointed after having tried for so long to get an answer to
this question but I will give it a last try.
I am trying to learn object oriented programming and for this purpose I
decided to redesign an existing application using exclusively unbound forms.
(I stress this fact because in my previously posted questions, well-meaning
friends on this site have suggested easier ways to get my job done using
bound forms, but this is not what I want.)
I have an unbound form, frmClients, with text boxes, and combo boxes on it.
The form is based on table tblClients and class clsClient. At the bottom of
the form I have placed navigation, edit, add and delete buttons with code
behind them. So far I have managed to make everything work as expected except
one thing.
I don’t know how to deal with the combo boxes. For example, in my previous
corresponding bound form I had cboNationality which was using the look up
table tlkpNationalities [ NationalityID (long), Nationality (string) ] as its
row source to pick up its values. Now, through the code I have written I have
succeeded to pass the NationalityID field value from my table to the combo
box (I have checked on this) but nothing is displayed (naturally) as the
combo’s row source is left blank. I want the combo box to be completely
ignorant of the database’s tables and queries (as it should be in oop) and
that’s why I have left it blank.
How can I make cboNationality functional again on my currently unbound form,
provided that I leave its row source blank?
A. Do I have to create another class, clsNationality, and initialize it in
the initialize event of my clsClient and then proceed from there?
B. Do I need to add code that queries tlkpNationalities in my Let and Get
procedures of the private variable for the nationality or what?
I am totally in the dark and stuck for so long! I would appreciate any help
with practical advice. I have never used class modules before and the various
textbooks don’t cover this issue at all, they only deal with textboxes.
Thanks in advance, George