returnvalues

Nirious

Registered User.
Local time
Tomorrow, 00:24
Joined
Jul 31, 2004
Messages
106
Is it possible to have something like this:

I have some code that gets data from a table to another table. But it detects that some of the fields that can't be null for the second table are indeed null. So a form pops up with a combobox on it, displaying all the values that are possible for that field. You pick one, and press that 'OK' button whish is also located on the popup form. the form closes and the code continues using the value you selected in the popupform and uses that value instead of the null-value.

Any id how to pull this off?

greetz,
Nirious
 
If this isn't possible to do, plz tell me so so I can stop looking for a solution. If it is possible but you don't know exactly how, but it can be done, than plz also reply. Any answer is a good answer.

Though the best answer would be a sollution ;)
 
Nirious said:
I have some code that gets data from a table to another table
It would have been easier if you posted the code you currently use. What you ask is certainly possible. You'd need to open a recordset based on the source table, and test for nulls first. When you find one, open your form to get the new value, and use it instead of the null when you append that record into the target table.

Probably no one answered because while it's possible, I suspect that there will be some hurdles to cross as you clarify your needs and situation. There isn't a simple answer to the question as posted.

From the sound of it, I'd open recordsets on each table, then use If/Then logic within .AddNew code to populate the target table from the source, using user input data instead of source table data when Nulls are encountered.
 
The code to replace the null-values with something else isn't really my problem and therefor irrelevant. What I'm asking is how I can know what the user selected on the popup form. So how do I get the return value of the form if there is such a thing?

Or do I set a variable (being a not visible textfield or something)on the original form to the value the user selected on the popup form and than use that variable 's value as the new value for the null-field?
 
Nirious,

You can have your popup form do one of several things.

Put the value onto a control on your main form:

Forms![YourMainForm]![SomeControl] = Me.SomeValue

Put the value into a variable that you have declared globally
(in a Public Module).

SomeGlobal = Me.SomeValue

Wayne
 
I must be missing something, as this seems too easy. You've described a pop up form with a combo box and OK button. Behind that button, simply set an already open form field or global variable (as appropriate to your app) to the value of the combo on the pop up form before closing that form. Then have the "Null" code use that.

A user created form doesn't have a "return value", as a message box would.
 
No, you're not missing anything. :p
I just wanted to know wether something existed like form returnvalues. As is appeares it doesn't but there are the usual work arounds. Thans for the reply both
 

Users who are viewing this thread

Back
Top Bottom