Data Range on a Form~!~ (2 Viewers)

vbaInet

AWF VIP
Local time
Today, 10:55
Joined
Jan 22, 2010
Messages
26,374
Give me an example of the values you entered.
 

vbaInet

AWF VIP
Local time
Today, 10:55
Joined
Jan 22, 2010
Messages
26,374
Yes, the dates.
 

LaRockera02

Registered User.
Local time
Today, 05:55
Joined
Oct 21, 2011
Messages
83
There you go
 

Attachments

  • SAMPLE%20Database[1].accdb
    1.2 MB · Views: 49

vbaInet

AWF VIP
Local time
Today, 10:55
Joined
Jan 22, 2010
Messages
26,374
I thought it would be obvious that you have code stopping the code below from executing properly. You commented everything else out but didn't comment out these two lines directly above the one I gave:
Code:
   Dim stLinkCriteria As String

DoCmd.OpenReport "SearchCallDat", acViewPreview, , Me.Filter
 

LaRockera02

Registered User.
Local time
Today, 05:55
Joined
Oct 21, 2011
Messages
83
Hey remember I told you I'm not the only that works on this database. I had no clue what that code does. I commented it out and plan to remove it later. Now it works but it still doesn't capture the end date.

for example if I want to search for records from 11/01 to 11/04, it would only give me up to 11/03. is there a "<=" (less than or equal) function I can use so those missing records can also display?
 

vbaInet

AWF VIP
Local time
Today, 10:55
Joined
Jan 22, 2010
Messages
26,374
It looks like this is a sample search form you got from somewhere. Am I right?

When you're writing code in VBA, regularly Debug > Compile your code. Did you notice that even after you renamed txtBegDate it was coming up in the VBA editor when you typed Me.?

So the above was part of your problem plus the Date field contained a Time part to it and the criteria in the query was just wrong.

See attached.
 

Attachments

  • SAMPLE%20Database[1].zip
    97.4 KB · Views: 54

LaRockera02

Registered User.
Local time
Today, 05:55
Joined
Oct 21, 2011
Messages
83
It looks like this is a sample search form you got from somewhere. Am I right?
I have no clue where the person who created the database got this form. It was made before I got here.

I was overwhelmed by the lack of organization in the code, especially because I only understand like half of it. Therefore, I didn't feel like changing anything that might affect the structure. Sorry for giving you a headache. haha :)

When you're writing code in VBA, regularly Debug > Compile your code. Did you notice that even after you renamed txtBegDate it was coming up in the VBA editor when you typed Me.?
For some reason I use to hit Ctrl + 8 (Run to Cursor).

I tried it and renamed a few things on the actual database to make it more legible. Now it works. I tried it various ways and it works perfectly now.

Thanks again for your immense help, I really don't know what I would do without your help hahaha :D:D:Dyou are awesome!!!

Hopefully this is the end of this database... :p
 

vbaInet

AWF VIP
Local time
Today, 10:55
Joined
Jan 22, 2010
Messages
26,374
Glad that worked for you.

As for the Compile thing, I don't think there's a shortcut key for it in the VBA editor. You can try searching on the net though.

I'm sure you will be back pretty soon ;)

Good luck with the rest of your project!
 

Users who are viewing this thread

Top Bottom