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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then else statement

Status
Not open for further replies.

5556

Programmer
May 27, 2003
17
0
0
US
I need an IF then else statement so if the origin value = 0 the record is not added to the table. This is the code I have.

SourceSet.AddNew
SourceSet!Employee_Name = Text137.Value
SourceSet!Stop1 = Combo0.Value
SourceSet!Origin = Combo8.Value
SourceSet!Stop2 = Combo2.Value
SourceSet!Stop3 = Combo4.Value
SourceSet!Stop4 = Combo6.Value
SourceSet!Stop1_dist = Text10.Value
SourceSet!Stop2_dist = Text13.Value
SourceSet!Stop3_dist = Text14.Value
SourceSet!Stop4_dist = Text15.Value
SourceSet!Datefield = ActiveXCtl22.Value
SourceSet.Update
SourceSet.AddNew
SourceSet!Employee_Name = Text137.Value
SourceSet!Datefield = ActiveXCtl65.Value
SourceSet!Origin = Combo54.Value
SourceSet!Stop1 = Combo46.Value
SourceSet!Stop2 = Combo48.Value
SourceSet!Stop3 = Combo50.Value
SourceSet!Stop4 = Combo52.Value
SourceSet!Stop1_dist = Text56.Value
SourceSet!Stop2_dist = Text58.Value
SourceSet!Stop3_dist = Text59.Value
SourceSet!Stop4_dist = Text60.Value
SourceSet.Update
 
Why not just set the Required field to YES for the Origin value? The user will not be able to add the record until a value is added.

"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
they should be able to submit the form without the origin value. i have each code block six times on the form and it is not required that the user fill in all six. So i just want the form to submit what the user fills out.
 
Sorry...I must be because it is Friday morning, but I'm confused as to what you are trying to accomplish:

You state:
I need an IF then else statement so if the origin value = 0 the record is not added to the table

Then you state:
they should be able to submit the form without the origin value

What exactly are you trying to accomplish? Can you give an example of a record that you do not want in the table?




"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top