Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Function based on ListBox (Access 2000)

    I need some help in rewriting a working function using a string into a function based on the choice from a list box.
    The function that i use now successfully is the following
    Public Function ftransform()
    Dim f As Form
    Set f = Forms![FOrderInformation]
    Dim strOrderID As String
    strOrderID = InputBox("Enter order number ")
    If strOrderID = "" Then
    Exit Function
    End If
    DoCmd.OpenForm "FOrderinformation", acNormal, , "OrderID=" & strOrderID
    f.RecordsetClone.FindFirst "orderid = " & strOrderID
    If f.RecordsetClone.NoMatch Then
    MsgBox "

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Function based on ListBox (Access 2000)

    What is the error?
    Does the variable strOrderID have the correct value?
    I notice that you had an instruction to test if the NoMatch was set, however you don't do that in the second example.
    HTH
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function based on ListBox (Access 2000)

    Public Function TheNewTransform()
    Dim f As Form
    <font color=blue>Dim varItm as Variant</font color=blue>
    Set f = Forms![FOrderInformation]
    Dim strOrderID As Control
    strOrderID = f![list] = date
    direct , this is a function
    End Function

    I'm assuming you are only selecting one item in the List Box and it actually is a List Box and not a Combo box. Try this function and see if it works. There are various ways to refer to the value selected in a list box. I just chose this one.

    Paul

Posting Permissions

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