Posts by StephenR

    Re: Time Mask Input


    This should work

    Re: VBA to Change data to Proper Format


    Try this:



    You had an errant '.' in front of Cells(i,4)=... And you need the StrConv function (though you could replace the '3' with vbProperCase).

    Re: Transferring data between controls


    Quote

    Do you mean that the records are stored in the worksheet ?


    Well, they are stored in the worksheet (for my purposes), but I also wanted to store them in a form for the user to edit. From what you say it makes sense to have a separate userform rather than different pages of a multipage.

    Re: Transferring data between controls


    OK. The user completes the form and can add any number of records, which are stored on the pressing of a command button (which also unloads the form so they can enter a new record). I want them to be able to look back on records they've previously entered and, if necessary, amend or delete them. I thought of putting the user-input bit on one page of a multipage and the stored values (in textboxes) on the second page. Given your explanation, perhaps it would be simpler to place the stored values in a separate form. Thanks in advance for any suggestions.

    Re: Transferring data between controls


    This is somewhat embarrassing as I've just noticed an 'Unload Me' which I thought I'd commented out. Sorry for wasting your time! However, this does lead me to another problem. Is there a way to unload one page of a multipage form.

    Re: Transferring data between controls


    Will, it gets curiouser and curiouser. I cut the file right down so that I could upload it here, and when I tested it it worked! So, the problem must lie in the bits I removed but the full file is 180Kb so I don't think I can upload it.

    Re: Transferring data between controls


    Thanks Will. I copied your example and it works for me too. Could the problem be related to the fact that I am using a multipage? Everything is on the same page, and I have tried using the full reference (multipage1.pages(0).textbox.value etc) but to no avail.

    I'm sure the answer to this is staggeringly simple but I'm stumped. I have a userform and I want to assign the value of a combobox to a textbox when a command button is pressed. However, nothing shows up in the textbox. If I 'transfer' the combobox value to the textbox and then to a worksheet (as below), it shows up in the sheet but the textbox is blank. What simple thing am I missing?


    Quote

    txtBox.Value = cboMet.Value
    ActiveCell.Offset(11, 0) = txtBox.Value

    Re: Multiple textbox validation & tab order


    Thanks norie. Believe it or not I spotted that and changed it and I could have sworn I got an error message but I must have done something wrong. Thanks a lot. Btw what's the significance of placing it outside a sub?

    Re: Multiple textbox validation & tab order


    norie,
    Apologies for reviving this long after it's probably slipped from your mind but I am having trouble understanding your attachment. I've just tried to get it to work on my form, exactly as it stands, but nothing happens. There's no error, but it doesn't stop me from entering non-numeric data. Any idea why this might be?
    Help from anyone at all welcome of course. Thanks. The code is as follows:



    Class Module


    Hello. I have a form with around 50 textboxes.


    Firstly, is there a quick way to set the tab order so that it is automatically in sequence, rather than having to go through each one manually?


    Secondly, is there a quick way to validate all 50 in one go? I want to ensure that only numbers 0-9 are entered in each textbox. Previously, I've used a validation script on a single textbox using KeyPress & Ascii codes 48-57, but I don't know if this can be adapted for multiple textboxes.


    Thanks in anticipation.


    Stephen

    Hello All,
    This is my first post here so apologies in advance if I'm doing anything sacreligious. I did try searching first, and although I think it must have happened before I couldn't find anything relevant.


    I have a userform with a 'Clear' command button (with the cancel property set to True) so that a user can clear a form half-way through and start again.


    Quote

    Private Sub cmdClear_Click()
    Call UserForm_Initialize
    End Sub


    The procedure it calls is as follows (there are more boxes but I assume it not necessary to show anything more than an example):



    After the Clear button is used, the form is reset and returns to the first combo box but the problem is that the options in all the combo boxes are duplicated, e.g. the first four are shown and then repeated underneath. This recurs every time it is pressed. I'm sure it must be something quite obvious but I can't see it. I copied most of this from another bit of script which works so I am mystified.


    Help would be gratefully received.


    Stephen