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

populating subform Textboxes

Status
Not open for further replies.

HansD

Programmer
Feb 12, 2002
60
NL
hello everybody

I am going grazy on this on:

I have a form (say: Frm_form) and in that a subform (say: Frm_Subform) on the form i have a combobox and a button.
On the subform i have 5 textboxes (say: Txt_Text1, Txt_Text2, etc).

I want to select something in the combobox and then press the button and the selected goes in Txt_Text1 (i have that to work) but the next time i press the button the selected has to go in Txt_text2, the next in Txt_text3, etc. And when i am finished i press a button "ready" or something.

I hope somebody could help me, because i don't know how to change from textbox1 to Textbox2, etc.

Tnx

Hans
 
Use an If...ElseIf...End If statement to test each text box in turn for IsNull(). The first text box that is Null is the one you want to fill on this button click.
Code:
    If IsNull(Txt_Text1) Then
        (fill Txt_Text1)
    ElseIf IsNull(txt_Text2) Then
        (fill Txt_Text2)
    etc.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hey Rickspr

Thanks for your fast reply

And it works!!!!!!

Thanks man for learning me something new

Hans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top