User Profile

Collapse

Profile Sidebar

Collapse
reginaldmerritt
reginaldmerritt
Last Activity: Mar 12 '13, 04:56 PM
Joined: Nov 4 '06
Location: Kings Langley, UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • reginaldmerritt
    replied to Dlookup with time criteria
    Doh! thought I was being really cleaver but fair enough. Thank you for your post and links NeoPa I have already added the pages to my favourites. Rabbit thanks for your alternative.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    twinnyfo many thanks for your time, it really helps to have someone to bounce idea of and help work though to a conclusion. We have definitely expanded my tool kit this mornin, thank you ;)
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    So the issue is with comparing to time values which appear to be the same but have a different serial fraction value.

    When using Dlookup there was no way for me to format or change the [TimeSlot], I could only format the Combobox or Text Field. So Instead of using Dlookup I have used a recordset to get each [TimeSlot], change this to the same format as the Combobox or Text Field and then compare the two. I chose to convert [TimeSlot]...
    See more | Go to post
    Last edited by reginaldmerritt; Aug 23 '12, 03:07 PM. Reason: typo

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    Actually twinnyfo there is another part of my program that time is not taken from a combobox so back to the drawing board
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    Great, thanks. So you don't have to use .column to refer to a combobox. That will work.

    I think the issue with Dlookup and Time could be the way access stores date and time as a number, with time being represented as a fraction. I tried using CDbl(dtTime) in Dlookup statement and this worked but not for all records in TBTime unfortunately.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    I mean it's unbound in the fact that the form itself is not accessing a table. All the controls are unbound.

    Try creating a new form, add a combobox, add a rowsource and then try to use .column to select data from the combobox. Let me know if that works, maybe it's a setting i need to change.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    This is very strange. I thought i would run though all the TimeSlots to see if there was a pattern to those that worked within Dlookup and those that did not.

    Code:
    dtTime = #12:00:00 AM#
    Debug.Print Format(dtTime, "dd mmm yyyy, hh:mm:ss")
    For i = 1 To 96
    Debug.Print "DLookup [TimeSlot] =" & dtTime & " " & DLookup("[TimeID]", "TBTime", "[TimeSlot] =
    ...
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    Thats a good shout twinnyfo, NextAvaliablePi ckupTime is a combobox to select Time but it is unbound. I can't seem to use NextAvaliablePi ckupTime.Column (0), i think this is because it is unbound.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to Dlookup with time criteria
    I thought if Time was a reserved word Access wouldn't let me use it. But I created duplicate table and renamed the field to [TimeSlot] but this made no difference.

    I understand where your coming from, could be that a date is being stored but with your debug code i can see that a date is not being stored.

    This is the results
    30 Dec 1899, 00:15:00_____2_ ____[TimeID = 2]
    30 Dec 1899, 13:53:11_____58 ____[TIME...
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    started a topic Dlookup with time criteria

    Dlookup with time criteria

    I have a table which just lists time slots. Every 15 mins from 9:00am - 5:00pm. The format of [Time] in TBTime is 'Medium Time'.

    e.g. TBTime
    TimeID___Time
    ___1_____9:00am
    ___2_____9:15am
    ___3_____9:30am

    I want to Dlookup the [TimeID] based on the [Time].

    When I used the code:
    Code:
    DLookup("[TimeID]", "TBTime", "[Time] = #" & Me.NextAvaliablePickupTime
    ...
    See more | Go to post

  • reginaldmerritt
    replied to IIF in query using "<" sign
    Just encase anyone is interested, in this instance using OR works a quicker than UNION, not by much but there are not many records at the moment and the time difference will probably be amplified as the system is used more.

    Thanks for your help Rabbit it is very obvious that OR works, thank you for pointing it out to me, sorry for not seeing this before adding this post.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to IIF in query using "<" sign
    Thank you very much Rabbit. I'll give both options a go and see which one works best.

    Thanks for your input NeoPa
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to IIF in query using "<" sign
    Thanks for all your help.

    Rabbit OR won't work with what I'm trying to do, but thanks

    twinnyfo, thank you for your example, that's a smart work around, but i think there is another way.

    The query looks for all [pickupdate] >= [returndate] but if [pickupdate] = [returdate] then i want to use the criteria that looks at ReturnTimePropo rtion.

    What i'll do is create two queries, one with [pickupdate]...
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    started a topic IIF in query using "<" sign

    IIF in query using "<" sign

    I'm trying to select certain records in a query using an embedded If statement. I want to us a "<" in the statement but can't see any information on how to do this.

    The IIF statement is

    Code:
    IIf(Format([Forms].[FRMExamVenueHireDetails].[PickupDate],"mm/dd/yyyy")=[ReturnDate],([TBExamVenueHire].[ReturnTimeProportion])<[Forms].[FRMExamVenueHireDetails].[PickUpTimeProportion])
    ...
    See more | Go to post

  • reginaldmerritt
    replied to The data has been changed
    Hi Smileycode, thanks for your post. Yes your right the problem is with changing an active record but I thought by using "me.dirty" and ".refresh" that I would have covered everything.

    I was trying to refresh just the field that was changed "Me.ExamVenueHi reStatusID.Requ ery" via the record set used in UpdateExamVenue HireStatus, I tried "me.refresh " instead but that didn't help, but I see where...
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    replied to The data has been changed
    Fair enough twinnyfo, thank you for your post.

    I don't have anything running OnCurrent but when i use a line toggle break on the 'if me.dirty then me.dirty = false' the error appears before it gets to that point. In other words the ExamVenueID_Aft erUpdate event doesn't even get to happen, therefore i have been unable to go though each line as Access kicks me out before its even begun.
    See more | Go to post

    Leave a comment:


  • reginaldmerritt
    started a topic The data has been changed

    The data has been changed

    This seems to be a common issue, I've read all the solutions to this I could find and I can't see where I'm still going wrong.

    I have two forms, one is a continuous list of records the other is a single record showing further details.

    From the single record form I save the record, then run a public subroutine which loops though all of the records and updates them, I then run a requery on both forms.

    ...
    See more | Go to post

  • Thanks, I knew there had to be some Activex control, i'm sure there has to be a horizontal control out there somewhere too.
    See more | Go to post

    Leave a comment:


  • Shame that there isn't an OnScroll event or a property that changes when the scroll bar is moved. Would be great if there was a property that showed how much the scroll bar has moved or the scroll bar current location.

    Perhaps there is a way of moving a control to a certain pixel location. Perhaps doing this on a timer event would be a good work around this.

    However, I've decided to fix this issue in another way. Rereading...
    See more | Go to post

    Leave a comment:


  • I can not identify how much the scroll bar has moved as I can not find property that relates to this.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...