Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a record in a SubForm after update

Status
Not open for further replies.

frog40

Programmer
Oct 25, 2006
69
US
I have 3 choices in an Option Group Frame on the Main Form. I have a SubForm for a different table. If the user clicks on the 1st Option, the SubForm table (check boxes) is filled in, but not updated yet.

If the user changes his mind and decides to choose Option 2 instead, the system automatically updates the data in the SubForm for Option 1.

When Option 2 i selected (after Option 1 was selected), I need to Go To the Record in the SubForm Table forOption 1, which is now updated and put the data back to null.

I have tried several different methods, but cannot get anything to work.

Thanks in advance
 
Yes, I did add the Quotes.

For the error Message "You tried to assign the Null value to a variable that is not a variant type", there is no line of Code that is highlighted. Once I click on OK to that message, I can continue to do whatever.
 
The option group is in the subForm. I put it in the Header as you suggested, but now it does not show on the Main Form. The only things that show on the Main Form are the check boxes and labels for B1ScrambledEggs, B1Toast, B2ScrambledEggs, B2Waffles, etc.
 
Put a breakpoint in the code and step it to discover which instruction try to assign a null value.
Also you'll may verify that froptBrkfst has a valid value (1, 2 or 3).

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
frog40 . . .

Checkboxes only accept [blue]True[/blue] or [blue]False![/blue] Apparently you replaced false with null. Reverse it back . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
I verified that all Group Options have a value 1, 2, 3

I changed all check box default values from No to False

I put a Breakpoint in the code, but since the error happens on the very first click, it told me nothing. I am new to using Breakpoints, so I may not be doing it correctly. I clicked on the left col and the breakpoint is entered automatically. Correct?

I moved the Group Option back to the Detail part of the SubForm, and now when I click on Option1, it gives me this message:
"Run Time Error 2465 - Can't Find the Field" -- the Code that is highlighted is "Me!(chkBox) = flg"
I thought I had it fixed, but apparently it happens only when a Group Option button has been clicked.
The"Null" error message still comes up when B1ScrambledEggs is checked.
 
I have another thought on this "Code". These menu items will be changed from time to time. When the User Manager changes the Lookup List for these menu items, the Code, as listed above, will not be changed. This presents a different problem of updating this Code. Am I correct?

I had seen a Code using Function AnythingChecked(chk). I tried to make this work, but my Code knowledge is so limited I did not get it right. Do you think there is a chance this Function Code that would work better (because it addresses ALL checkboxes at once, instead of individual ones). If so, can you give me the correct Code to make it work?
 
the Code that is highlighted is "Me!(chkBox) = flg"
And what is the value of chkBox at that time ?
FYI: to see the value of a variable in debug mode simply put the mouse cursor inside the name of this variable in the code.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The name of the variable in the Code is: chkB1ScrambledEggs

The Default Value of chkB1ScrambledEggs = False. (Is the Default Value suppose to change if working correctly?) Is there another place to check on the Value?
 
Double check the ControlSource property of the control named chkB1ScrambledEggs.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am not sure what you are asking me to do. The check box for B1ScrambledEggs Name is: chkB1ScrambledEggs

The Control Source is: B1Scrambled Eggs

Is this what you are asking?
 
I am not sure what you are asking me to do
You have the following error:
"Run Time Error 2465 - Can't Find the Field"
raised by the following code:
Me!("chkB1ScrambledEggs") = flg
 
I think we are getting lost in translation here.

I am asking you to help me get past these error messages.
You asked me to "doublecheck the Control Source for chkB1Scrambled Eggs". I thought that is what I did and responded in the previous post.
I just wasn't sure what to doublecheck for.
 
frog40 . . .

I read over this thread quite a bit and confusion appears to grow with its length. Follow this:

On [blue]6 Aug 07 16:59[/blue]:
frog40 said:
[blue]I have 3 choices in an Option Group Frame on the Main Form. I have a SubForm for a different table. If the user clicks on the 1st Option, the SubForm table ([purple]check boxes[/purple]) is filled in, but not updated yet.[/blue]
Along the way you've given the names of these checkboxes prefixed with [blue]chk[/blue].

On [blue]12 Aug 07 13:10[/blue]:
frog40 said:
[blue]The option group is in the subForm. I put it in the Header as you suggested, but now it does not show on the Main Form. [purple]The only things that show on the Main Form are the check boxes and labels for B1ScrambledEggs, B1Toast, B2ScrambledEggs, B2Waffles, etc.[/purple][/blue]
I'm totally blown away here! [surprise] You have the same equivalent checkboxes in the mainform!

See my profile (click on my name) . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
You have a very impressive profile and I have no doubt that you are as capable a programmer as anyone I have seen. Believe me, I am not jerking you around. The subForm header does not show up on my main Form.

In the past (somewhere along the way), I had put in VBA to give B1ScrambledEggs a null value. But, by your suggestion, I have deleted all those old VBA events. What is the best way to delete an old event, other than using the Delete key? I still get a plain white page when I go back to the control that had the original event. Can I just bring up all events somewhere and delete them by name, just to make sure I get them all?

I cannot find any event that suggests a "Null" value in it.

I cannot get back to this until this evening. Then I think I will delete the subForm altogether and create a new one. Somehow, things seem to be getting very jumbled up. I am sure it is my own inexperience, but I just don't know exactly what I am doing to cause this.

Thanks for hanging in there with me.
 
frog40 . . .

I didn't send you to my profile for that, there's something you missed on the 1st line! . . . [thumbsup2]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top