Click to See Complete Forum and Search --> : No value given for one or more parameters
Crucifer
Jul 26th, 2002, 05:10 AM
I am writing an application that uses the code:
Me.AddOwnedForm(frmLI)
frmLI.ShowDialog()
If InitData() = False Then
End If
When I get to the line frmLI.ShowDialog() I get the error:
No value given for one or more parameters
And then the form loads. Anybody got any ideas on why I get this message? Please advise.
Also, when I place the 'offending' code in a try block it doesn't raise an exception! Sheesh...
Edneeis
Jul 26th, 2002, 10:09 AM
Is there any code in the form_load event? Maybe the offending code is in there.
Matt02
Jul 26th, 2002, 04:51 PM
I'm not sure exactly why you can't use those two statements together, but I do know that there is no reason why you would use them together. The AddOwnedForm will bind a secondary form to a primary one so that it will be closed if the primary one is, will be minimised if the primary one is and always be on top of the primary form. ShowDialog sets the window to be always on top and won't let you interact with the form it was launched from until it is closed. So either drop the AddOwnedForm or change ShowDialog to just Show and that should fix things up.
Crucifer
Jul 29th, 2002, 03:32 AM
Yea I tried all that...I been programming this stuff for about 5 or 6 years now...what is even more interesting is that first I couldn't find anything like that error message in MSDN, in Knowledge Base, or a straight Google and Yahoo search.
The second most interesting thing is that the program was basically doing this :
It is a program similar to a roladex that I am using to manage some customer records that I have.
It is using VB.NET front end and ADO.NET to access Access backend (2 Tier). All my forms are declared in a standard module and are instantiated when necessary. I have one simple class that I designed (actually more of a UDT than class functionality-wise, only properties, no functions) and it is a Customer class that stores basic customer info (e.g. login_id, name, address, etc).
When you start the program it first loads all the customers from the db into an instance of a Customer class and then I add each populated class to a combobox. When you want to update the login and password for the customer you select the customer in the combobox, click Edit \ View Logins from the menu, and that Edit \ View Logins form is then shown modally.
The code in the menuitem has only to do with loading the Edit \ View Login form. Nothing datawise. It isn't until you click 'Update' on the Edit \ View Login form that any data validation or updating occurs. And no, not even in the form_load().
Here is the interesting part:
If an existing record for that customer is in the database then I get that error(?) and if there is no record it works the way it should. And again, I say error(?) because I couldn't catch it in a Try block. It happens right after I call frmLogin.ShowDialog().
The bad news:
This problem (and I am a fairly resourceful programmer) may forever go unsolved because after finally frustrating myself until I couldn't take it anymore I decided to streamline the program some more and rebuild it, thus the code is gone. (Good thing or bad I am not sure becuase I don't like to not know things).
Anyways, let me know if this helps anyone with some ideas.
This is probably one of the most frustrating things I have ever come across and as a matter of fact the only thing I have come across that I couldn't get an answer for. I am keeping my ears open and my eyes peeled...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.