Posts by boromuse

    Re: Sql query 2 date values & 2 time


    The Datefrom & Dateto are from the table booking



    This is the is the one version i have got but cannot find the one that i used with the between clause and the text boxes are off the form
    The query populates a list box in the form, hope this answers what you asked for

    Ok i'm creating a list box that holds the results for an sql statement but i cannot get it right
    what i'm trying to do is display record where the car is booked to say that it is unavailable


    4x text boxes on a form
    1x table called booking


    txtdatefromvalue => booking.datefrom
    txtdatetovalue <= booking.dateto


    txttimefromvalue => booking.timefrom
    txttimetovalue <= booking.timeto


    i have tried to get it working but it does not work with a between value i have been told to concatinate the values but i dont no where to start so please can someone help me sort this issue out :confused:
    Thank you

    right this code is hit and miss works one second then comes up with a global error! running through access 97 exporting to excel 97


    Re: using replace in string value


    right what i have got is a form with a txtbox that has date format as "06/02/2006" so thats "dd/mm/yyyy"


    then it creates the query

    Code
    DoCmd.OpenQuery ("qryStaffListQuery")


    this opens up and has the criteria as "mm/dd/yyyy" which is a complete pain!
    cause i would have to reorder my date but saying that i have just thought i could just format the result to a hiden txtbox or string with the format of "mm/dd/yyyy" !!!!

    Re: using replace in string value


    ok this is annoying get another problem!!!


    everything is running spot on but when i run there query after everything being set to the "dd/mm/yyyy" it opens the new query and the date is being set in the way of the US "mm/dd/yyyy" so WTF how do i stop this????

    Re: using replace in string value


    also the reason why im using format of "06/02/2006" is because im running a query where it saves the data that has the same date but then when saving the file i'm saving it as "06_02_2006" as the date format is not valid! :)

    Re: using replace in string value


    Quote from norie

    Could you not use Format?

    Code
    Dim stdText As String
    stdText = "05/02/2006"
    If IsDate(stdText) Then
        stdText = Format(stdText, "ddmmyyyy")
    End If
    
    
    MsgBox stdText


    I had not actually thought of that :)
    thank you for the idea

    Re: access format xl


    strsheet is the name of the page saved in excel but i have now changed that to have it as numerical and just use the file name as the date and everything is all cool now!
    was me being stupid lol

    right this worked fine at home but does not at work!!!!


    stdtext is the date format "05/02/2006" after this runs on my pc which is running office 2000 it converts it to "05_02_2006"


    now at work we are running 97 which probably is the reason why it does not work! Please can anyone help me?

    Re: access format xl


    Quote from norie

    Sorry I don't understand.:)


    You can't save a workbook with that date format, it's an invalid filename.


    Excel saves it as the date and instead of using the "/" it uses "_"
    what i need to do is break the date in to the sections and it will work cause it just selected the sheet and ran through it!