Re: AfterUpdate Event not Running

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Tom;
Thanks to your help yesterday, I'm off now
trying to better understand code via the use of the
immediate window, as you suggested.
.....them poor hokies,,,,, wow,,,,
Jim

"Tom Ogilvy" <twogilvy@xxxxxxx> wrote in message
news:um6aI0u4FHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
> txtVenName isn't an object until the userform is loaded.
>
> You can do that by refering to it. so in the immediate window:
>
> ? userform1.TextBox1.Parent.Name
> UserForm1
>
> In Leith's code, the userform was already loaded.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
>
> "Jim May" <jmay@xxxxxxx> wrote in message
> news:aVmbf.9844$wC.5364@xxxxxxxxxxxxx
>> Leith, thanks for the code;
>> notices the use of
>>
>> 'Get the Name of the Form the TextBox is on
>> frmName = TB.Parent.Name
>>
>> Is this sort of line available generically to any Userform.?
>>
>> I went into a Userform (VBE) and selected a textbox
>> txtVenName and in the immediate window did:
>>
>> ? txtVenName.Parent.Name << expexting to get frmTest
>> but instead get r/t error 424 - Object required.
>>
>> Can you clarify
>> Thanks,
>> Jim
>>
>>
>> "Leith Ross" <Leith.Ross.1y1zrm_1131243901.8145@xxxxxxxxxxxxxxxxxxxxx>
> wrote
>> in message
>> news:Leith.Ross.1y1zrm_1131243901.8145@xxxxxxxxxxxxxxxxxxxxxxxx
>> >
>> > Hello Craig,
>> >
>> > I suspect you may have ambigious text box names. It isn't clear from
>> > your post if you are calling Update_Inventory from the other forms.
>> >
>> > I have cleaned your code up and added a restriction to it. If the text
>> > box isn't on frmThree then exit the routine. Look this over and let men
>> > know if I have understood you correctly or not.
>> >
>> > CALLING THE SUB:
>> > Update_Inventory (TextBox3)
>> >
>> > UPDATED CODE:
>> >
>> > Code:
>> > --------------------
>> >
>> > Sub Update_Inventory(ByRef TB As MSForms.TextBox)
>> >
>> > Dim frmName As String
>> > Dim tbName As String
>> > Dim tbNumber As Integer
>> >
>> > 'Get the Name of the Form the TextBox is on
>> > frmName = TB.Parent.Name
>> >
>> > 'Is TextBox on frmThree?
>> > If frmName <> "frmThree" Then Exit Sub
>> >
>> > 'Get the TextBox Name
>> > tbName = TB.Name
>> >
>> > 'Extract the TextBox Number
>> > tbNumber = Val(Mid(tbName, 8, Len(tbName) - 7))
>> >
>> > If tbNumber <= 20 Then iPass = tbNumber + 171
>> > If tbNumber >= 21 Then iPass = tbNumber + 151
>> >
>> > 'Format the TextBox Text as Currency
>> > TB.Text = Format(TB.Text, "Currency")
>> >
>> > If tbNumber <= 20 Then SpecialCount.Cells(iPass, 14).Value = TB.Text
>> > If tbNumber >= 21 Then SpecialCount.Cells(iPass, 26).Value = TB.Text
>> >
>> > TextBox116.Text = Format(SpecialCount.Range("Z190").Value, "Currency")
>> >
>> > End Sub
>> >
>> > --------------------
>> >
>> > Sincerely,
>> > Leith Ross
>> >
>> >
>> > --
>> > Leith Ross
>> > ------------------------------------------------------------------------
>> > Leith Ross's Profile:
>> > http://www.excelforum.com/member.php?action=getinfo&userid=18465
>> > View this thread:
> http://www.excelforum.com/showthread.php?threadid=482515
>> >
>>
>>
>
>


.



Relevant Pages

  • Re: setfocus in textbox on multipage
    ... firstpage of a 2 page muultipage on top of a userform. ... I dont get errors with code shown but dont get focus in textbox either. ... "Jim Cone" wrote: ... Text1 has a tabindex of 0. ...
    (microsoft.public.excel.programming)
  • Re: Mit Userform in Excel suchen
    ... sind sechs Label (Name, Vorname, Tel. Privat....) und darunter ... Userform ... textname (Textbox) Vorname ... Auf dem kann ich entweder nach Name oder Vorname suchen (wenns ...
    (microsoft.public.de.excel)
  • =?Utf-8?Q?Re:_Eingabe_in_einer_Textbox_sch?= =?Utf-8?Q?lie=C3=9Ft_Eingabe_in_einer_anderen_T
    ... In meiner Userform gibt es die Textboxen txtStückzahl, ... Textbox txtGesamtbox kann man nichts eingeben; ... soll dann in der Textbox txtGesamtpreis der errechnete Preis ... If Not IsNumericThen ...
    (microsoft.public.de.excel)
  • Re: Add Controls Dynamically
    ... on a prefacing UserForm, but it could come from a variety of sources; ... passed from another procedure; a TextBox on this UserForm; a ComboBox on ... the reason I limit "HowMany" to 120 or less. ... Dim oTextBox As TextBox ...
    (microsoft.public.word.vba.general)
  • Re: Why doesnt this work ?
    ... > Actually the Hnandle of the UserForm is different from that of the TextBox ... You aren't getting the window handle of the UserForm itself, ... * Take your Excel development skills to the next level. ...
    (microsoft.public.excel.programming)