Hi, I have to print all the students who live in Florida. Keeps saying no current record but in my database there are students from Florida.
Please Login or Register to view this content.
Hi, I have to print all the students who live in Florida. Keeps saying no current record but in my database there are students from Florida.
Please Login or Register to view this content.
Last edited by excel girl; 11-08-2015 at 04:29 PM.
Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)
Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?
To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
(note: this change is not optional )
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Suggest removing the
line and the corresponding End If line to see if anything is being pulled back. If it isn't then you problem is elsewhere.Please Login or Register to view this content.
You might want to make the title of this thread a bit more descriptive to allow others to benefit from your question in the future.
Martin
Mince, I put that line in order to check for students from Florida. The debugger keeps highlighting that line but I need to search based on Address.
What happens if you remove the lines I suggested - do you get a lot of output appearing in the Immediate pane or nothing at all?
I also noticed that you had a field called StudenttName - could this be a misspelling?
No output when I removed as you suggested. No StudentName is an actual field.
I just noticed that your field for the name has two t's in the field name
StudenttName Is this a typo or an error in your code and is this the reason your code may be failing?
Otherwise have you considered running a query from the QBE to get the results.
Last edited by alansidman; 11-09-2015 at 08:48 PM.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
why not just incorporate into your openrecordset
Set rec = db.OpenRecordset("SELECT * FROM StudentsInfo WHERE Address='Florida'")
just to be clear - are your addresses just 'Florida','Texas' or do they contain other elements such as a house number, city, postcode etc?
If they do then your search won't work because = means the whole field, you would use LIKE instead with *'s
Set rec = db.OpenRecordset("SELECT * FROM StudentsInfo WHERE Address Like '*Florida*'")
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks