Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    > No of People (A2000)

    I have a pop-up form with the following
    combo18 (2 columns) tableId & MaxPeople
    textbox NoOfPeople
    on the after update of NoOfPeople, I'm trying to create a message box if the No of People is greater than column2 in combo18

    Ive tried all ways and am stumped




    Dave

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: > No of People (A2000)

    Use
    If Me.NoOfPeopple > Me.Combo18.Column(1) Then
    Msgbox "My Message"
    End If
    The column number begin to tell with 0 so for the second column you use 1
    Francois

  3. #3
    Star Lounger
    Join Date
    Feb 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: > No of People (A2000)

    Hmmmmmmm

    I've tried this Francois but fails to work.
    Let me break it down a little

    The forms control source is tblRestarauntDetails.

    The combo18 control source is TableNo with a rowsource of :-
    SELECT [tblTableDetails].[TableId], [tblTableDetails].[MaxPlaces] FROM tblTableDetails;

    The field NoOfPeople control source is NoOfPeople

    Does this help

    Dave

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: > No of People (A2000)

    I think that between the Me and NoOfPeople (as well as Me and Combo18) there should be an !

    As in: Me!NoOfPeople > Me!Combo18.Column(1)

  5. #5
    Star Lounger
    Join Date
    Feb 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: > No of People (A2000)

    I'm not very good at VB code but here's what I've done.

    I created a text in the form footer "text33" with the control source as "=[Combo18].column(1)"

    Then on the after update of NoOfPeople I put:

    Private Sub NoOfPeople_AfterUpdate()
    Dim max As String
    max = text33.Value
    If Me.NoOfPeople > max Then MsgBox "help"

    End Sub

    And it Works !!

    Thanks for the help, sometimes its a help just bouncing problems off another person.

    Dave

Posting Permissions

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