Fill text box in userform

User avatar
HansV
Administrator
Posts: 78788
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Fill text box in userform

Post by HansV »

"the form does not seem to open" - do you get an error message? If so, what does it say?
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Fill text box in userform

Post by adam »

No I don't get any error messages. Instead when I click the macro button. It does not open
Best Regards,
Adam

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Fill text box in userform

Post by Rudi »

I don't think you have a name range called "StaffList"?

Either you must create a name range called "StaffList" OR
You must replace IDArray = ws.Range("StaffList") with something like IDArray = ws.Range("A10:A20").

Please note that "A10:A20" is a sample range. I don't know what you intended as the original "StaffList" range!
Last edited by Rudi on 04 Apr 2010, 21:02, edited 1 time in total.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Fill text box in userform

Post by adam »

Thanks Rudi. Your suggestion works fine. Im happy now
Best Regards,
Adam

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Fill text box in userform

Post by adam »

If I want to add the lines txtBillDate, txtReceiptDate how could I added them to the code in the post=12465
Last edited by HansV on 26 May 2010, 18:45, edited 1 time in total.
Reason: to make link to post clickable: [post=12465]post=12465[/post]
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78788
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Fill text box in userform

Post by HansV »

You can add more parts like

And ctl.Name <> "txtStaffID"

before the keyword Then.
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Fill text box in userform

Post by adam »

Thank you for the help Hans.
Best Regards,
Adam