> Try:
>
> MyCompAccount = DLookup("[Account]", "[ComplaintTickets]", _
> "StartTime=" & Format(Forms![frmSplash]![CompDate], "\yyyy\-mm\-dd\#"))
>
> TradeAccount = DLookup("[Account]", "[Pending Tickets]", _
> "DAT=" & Format(Forms![frmSplash]![TradeDate], "\yyyy\-mm\-dd\#"))
>
> No idea why it would work on some machines but not on others though.
>
> --
> Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele> (no private e-mails, please)
>
> "R Tanner" <nouveauricheinvestme...[ at ]gmail.com> wrote in message
>
> news:c200b03a-e2e8-4390-9f73-d345fc9b1d0c[ at ]g1g2000pra.googlegroups.com...
>
>
>
> > On Dec 22, 9:53 am, "Jeff Boyce" <nonse...[ at ]nonsense.com> wrote:
> >> ?Perhaps the field being DLookedUp has a null value, even though a record
> >> exists?
>
> >> Regards
>
> >> Jeff Boyce
> >> Microsoft Office/Access MVP
>
> >> "R Tanner" <nouveauricheinvestme...[ at ]gmail.com> wrote in message
>
> >>news:2f31542a-e207-4c92-a85c-62d259c92981[ at ]l38g2000vba.googlegroups.com....
>
> >> >I have a main form with a dlookup function that looks up an account
> >> > number based on another textbox that is looking up the oldest record
> >> > in my table. This is all fine and dandy and works wonderfully on most
> >> > of my users' computers, but there are a couple people whom my dlookup
> >> > function returns a null error. I don't get it, because I know there
> >> > are records there. There IS an account number there in the table for
> >> > this record, and it works fine on every computer except two...What
> >> > could cause this?
>
> > Nope. The field I am looking up is not null. The dlookup function
> > works fine on my computer, as well as most of the users' computers.
> > There are a few computers it does not work on though. This is my
> > code, so you know what's happening:
>
> > Public Function CheckForOverDueTickets()
>
> > Dim MyForm As Form
> > Set MyForm = Forms![frmSplash]
>
> > Dim ComplaintHours As Long, MyCompDate As Date, MyCompAccount As Long,
> > TradeHours As Long, TradeDate As Date, TradeAccount As Long
>
> > On Error GoTo NoComplaint
> > MyCompDate = DMin("[StartTime]", "[ComplaintTickets]",
> > "[ComplaintTickets].StatusID=2")
>
> > ComplaintHours = DateDiff("h", MyCompDate, Now)
>
> > Forms![frmSplash]![CompDate] = MyCompDate
> > Forms![frmSplash]![CompDif] = ComplaintHours & " Hours Unresolved"
>
> > MyCompAccount = DLookup("[Account]", "[ComplaintTickets]",
> > "ComplaintTickets.StartTime=Forms![frmSplash]![CompDate]")
> > Forms![frmSplash]![CompAccount] = MyCompAccount
>
> > GoTo TryTrades
>
> > NoComplaint:
>
> > MyForm![CompLabel].Visible = True
> > MyForm![CompDate].Visible = False
> > MyForm![CompAccount].Visible = False
> > MyForm![CompDif].Visible = False
> > MyForm![NoComplaints].Visible = True
>
> > TryTrades:
>
> > On Error GoTo NoTrade
> > TradeDate = DMin("DAT", "[Pending Tickets]", "[Pending
> > Tickets].Status=2")
> > TradeHours = DateDiff("h", TradeDate, Now)
> > Forms![frmSplash]![TradeDate] = TradeDate
> > Forms![frmSplash]![TradeDiff] = TradeHours & " Hours Unresolved"
> > TradeAccount = DLookup("[Account]", "[Pending Tickets]", "[Pending
> > Tickets].DAT=Forms![frmSplash]![TradeDate]")
> > Forms![frmSplash]![TradeAccount] = TradeAccount
>
> > Exit Function
>
> > NoTrade:
> > MyForm![TradeLabel].Visible = True
> > MyForm![TradeDate].Visible = False
> > MyForm![TradeAccount].Visible = False
> > MyForm![TradeDiff].Visible = False
> > MyForm![NoTrades].Visible = True
>
> > End Function
>
> > On my computer as well as most other computers, this works fine. On a
> > select few computers (2 to be exact), the dlookup function for the
> > account number throws a null error. I have went back into the
> > database and looked up the record with the date which is returned by :
> > MyCompDate = DMin("[StartTime]", "[ComplaintTickets]",
> > "[ComplaintTickets].StatusID=2") and there are no problems with it.
> > There is an account number there.- Hide quoted text -
>
> - Show quoted text -