|
-
Feb 19th, 2001, 11:14 PM
#1
Thread Starter
Addicted Member
Hi!
My project relies heavily on data forms, so I decided to build a data ActiveX which will consist of two forms. One will be the main interface with five buttons (First, Previous [Record # of #] Next Last New) with text field in the middle, and five more buttons on the right side allowing to edit the current record, delete, find, cancel or save. The behaviour will be much like in the data forms produced by the data form wizard. In fact, I want to build the ActiveX based on the class generated by the wizard. The only problem that I am facing is that the class has all the Property Get and Property Let procedures defined for each of the fields in the recordset, but because my ActiveX should work with any recordset, how do I expose each of the fields to my applications?
The second form in the ActiveX will pop up when the user presses the Find button. The Search will display hits in a listbox and upon double-clicking the listbox the form will be closed and the ActiveX will be repositioned to the chosen record.
How do I solve this problem? I think it would be awkward to always use the wizard to generate data-access classes and although this is the OOP approach, it's not really reusable.
Thank you very much for your help!
Stanislav
-
Feb 21st, 2001, 02:12 PM
#2
Fanatic Member
Hi,
Unless you know ALL field names for all combinations, then you cant use properties. You will need to use the recordset itself. By passing the recordset to the ActiveX you can build on the fly based on the records in the recordset. i.e.
dim f as fields
for each f in rs
'code goes here to build the screen.
'f.name for example will give you the field name
next
Hope this helps.
-
Feb 21st, 2001, 10:41 PM
#3
Thread Starter
Addicted Member
Thanks for the help, but...
Thanks!
The problem is that I do not want to build an ActiveX incorporating text boxes for all fields in the recordset, but rather a small control much like the ADO control to which all other text boxes can be bound. I understand that they may not be bound via the designer, but I can surely do this via code. I am beginning to figure it out, though. The event GetDataMember of the recordset class gets all fields, so I think there won't be a problem.
The 2 problems now are:
1) In a custom ActiveX control, can I make additional forms that pop up and interact with the main ActiveX control (the Find form that I want to build)
2) Are there examples of something similar out there? Did anyone try to build a generic Data control much like the ADO control, but incorporating operations besides MoveFirst, MovePrevious, MoveNext and MoveLast (the ADO control lets you do that and nothing else)
Thanks immensely for your help!!!
Stanislav
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|