Link to home
Start Free TrialLog in
Avatar of kiranboi
kiranboi

asked on

By-passing compile time object exists check

Hey guys, hope someone can help me fairly urgently. I am writng code that will be re-used in various differing applications and basically I want whoever ends up developing software to be able to decide which information to have on their form.
I am simplyfying things by creating some code we can reuse, in this code I am making it write to an object on the form (a series of text boxes) of which some may not exist. I want to be able to skip the VB code-checking facility so that I can compile and run the code and just have an error checker that supresses when data is sent to an object that doesn't exist.

So, to re-word that a bit, I have say 20 pieces of data, when i call a function from my class file I want it to take a reference, look through an object I have already created, locate the record and attempt to write the data to 20 text boxes, whether the developer has put them on the form or not. If they don't appear on the form then I want the code to siply go to the next piece in the record and attempt to move that to a text box.

We all know VB throws a strop and says that if text1 doesn't exist on form1 it wont compile...I wanna supress this and then write code that supresses it at run-time.

Hope soemone can help!
cheers!


PS: I can't change my object that I access the data out of or the way I do that, i can just access it for read or write and I want to do the middle add-in between a form calling one of a small set of methods and the actual code writting out and in upto a hundred pieces of data per record (and some other data manipulation)

Oh, and if someone could tell me what the 'return' line is in code (i.e., insert 'new line' in a string' that would really rock too!)
SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of plenderj
plenderj

Surely something like iterating all available controls of type Textbox on the form would be a better approach?
Avatar of kiranboi

ASKER

I couldn't do that plenderj because I do not know which textboxes the programmer will eventually use nor in what order and so i will end up with text boxes with the wrong data in and some of the data is going in combo boxes, checkboxes etc.
I wondered if for the purposes of 'building' that there may be a way to remove all the debugger stuff and force a build with the errors in?
hope there is a way, else I'm writting things in a completely new way lol
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I believe that would only work if you explicitly set Option Explicit Off
plenderj.  Correct.  Sorry, I took that "as read", but you're probably right to make it explicit.

Roger
OK, thanks guys for all your help - going to get admin to split the points.
Cheers