Consulting

Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 40 of 65

Thread: Date Problems on VBA Forms

  1. #21
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,189
    Location
    I have posted an example sheet with this in action.

    Hope this helps.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved

    Excel 365, Version 2403, Build 17425.20146

  2. #22
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Hi guys,

    I've been trying to work out how to use a command button on a form to open another userform. I can't for the life of me work it out.

    Can anyone help???

  3. #23
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,189
    Location
    Do you mean like this?

    Hope this helps.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved

    Excel 365, Version 2403, Build 17425.20146

  4. #24
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by WillieC
    Hi XLD,

    If you still have the file I sent, you'll see that there are two textboxes that say Mat Date and Act Date. Is is possible that when a user clicks on these that a calendar automatically "pops up" for them to select the date?
    That's what I was alluding to earlier, and I would just make it non-visible until you enter one of those textboxes, then use ActiveControl to trap it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #25
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Quote Originally Posted by xld
    That's what I was alluding to earlier, and I would just make it non-visible until you enter one of those textboxes, then use ActiveControl to trap it.
    Would you have a piece of code that I could insert? I can't get it going.

    Cheers again for all your help

  6. #26
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Can you post your workbook again, I have deleted it?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #27
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Removed
    Last edited by WillieC; 10-09-2008 at 06:03 AM.

  8. #28
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Hi there,

    So far the form is working well. I have come across just one problem. When testing the form with more than one user, if they both clicked ok to store the data it come with conflicting interests. How can I program my form so that more than one user can put the data onto the spreadsheet at the same time?

  9. #29
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Morning, XLD. Any joy with my question?

  10. #30
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I thought you had overcome the problem, that is how I read the last post post of yours, and you removed the file.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  11. #31
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    I had resolved the previous problem. The one I have come across now is that 2 users can't enter the same data at the same time. If they both click ok at the same time then a conflict error comes up.

  12. #32
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Hi there,

    I've uploaded the file again in the hope that you or somebody else can help, XLD.

    Basically what I need done is for two or more users to be able to click OK at the same time and for the data to go onto the worksheet instead of getting conflicting errors.

    Apologies for being a nuisance but this is doing my head in lol

  13. #33
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Sorry, there is no point in hoping that I will help, I avoid shared workbooks like the plague and have no idea of how to solve the problems that they create.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  14. #34
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    No worries, XLD, hopefully someone else can help.

    Thanks for all your help so far. You've been a star

  15. #35
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Another question for you guys if possible.

    How do I have it so that if a certain option is chosen from a combobox then other fields are greyed out and can't be used??

  16. #36
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Presuming you are using the combo boxes as drop-down lists (no editing), you should be able to use the change event of the combo box and trap either the val (if single col box) or better yet, the list index.

  17. #37
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Quote Originally Posted by GTO
    Presuming you are using the combo boxes as drop-down lists (no editing), you should be able to use the change event of the combo box and trap either the val (if single col box) or better yet, the list index.
    Sorry, GTO, what do you mean? I'm quite a newbie when it comes to VBA

  18. #38
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by WillieC
    ...How do I have it so that if a certain option is chosen from a combobox then other fields are greyed out and can't be used??
    Hey there WillieC,

    Presuming you were asking as to disabling another combo/text/similar control based on a certain value (option) being chosen, I was just answering that this is possibly a couple of different ways.

    Here's an example that disables the 'AddRemove' box anytime that "Mat Form" is chosen in the 'WhereFrom' box.

    Mark


    [VBA]Private Sub cboWhereFrom_Change()
    If cboWhereFrom.Value = "Mat Form" Then
    cboAddRemove.Enabled = False
    Else
    cboAddRemove.Enabled = True
    End If
    End Sub
    [/VBA]

  19. #39
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Quote Originally Posted by GTO
    Hey there WillieC,

    Presuming you were asking as to disabling another combo/text/similar control based on a certain value (option) being chosen, I was just answering that this is possibly a couple of different ways.

    Here's an example that disables the 'AddRemove' box anytime that "Mat Form" is chosen in the 'WhereFrom' box.

    Mark


    [vba]Private Sub cboWhereFrom_Change()
    If cboWhereFrom.Value = "Mat Form" Then
    cboAddRemove.Enabled = False
    Else
    cboAddRemove.Enabled = True
    End If
    End Sub
    [/vba]
    Hi Mark,

    That's worked perfectly. Thanks very much mate.

    Just two other things that I could do with some help with.

    1. When more than one user is using the form, if they click on OK and Save at the same time, a conflict error comes up as the form tries to enter both sets of data into the same row. Any ideas how to solve this?

    2. When a user opens the Form, I'd like Excel to minimize so that the form will appear on screen and can be used without having to have Excel in the background.

    Thanks again for all your help

  20. #40
    VBAX Regular
    Joined
    Oct 2008
    Posts
    36
    Location
    Quote Originally Posted by GTO
    Hey there WillieC,

    Presuming you were asking as to disabling another combo/text/similar control based on a certain value (option) being chosen, I was just answering that this is possibly a couple of different ways.

    Here's an example that disables the 'AddRemove' box anytime that "Mat Form" is chosen in the 'WhereFrom' box.

    Mark


    [vba]Private Sub cboWhereFrom_Change()
    If cboWhereFrom.Value = "Mat Form" Then
    cboAddRemove.Enabled = False
    Else
    cboAddRemove.Enabled = True
    End If
    End Sub
    [/vba]
    Hi Mark,

    That's worked perfectly. Thanks very much mate.

    Just two other things that I could do with some help with.

    1. When more than one user is using the form, if they click on OK and Save at the same time, a conflict error comes up as the form tries to enter both sets of data into the same row. Any ideas how to solve this?

    2. When a user opens the Form, I'd like Excel to minimize so that the form will appear on screen and can be used without having to have Excel in the background.

    Thanks again for all your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •