View code

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

View code

Post by bknight »

It has been far too long to view codes on my Dbs, that being said I have a Db when opening, a form opens, all well and good, except the path is incorrect to link a spreadsheet, new HD and all. So where do I view the code that is executed so I may change the path?

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

Re: View code

Post by bknight »

Where the command is to load a specific form is still unknown, but all is linked good.

User avatar
HansV
Administrator
Posts: 73871
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: View code

Post by HansV »

If the form opens automatically when you open the database, look at File > Options > Current Database, and inspect the Display Form dropdown.

S1011.png
You do not have the required permissions to view the files attached to this post.
Regards,
Hans

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

Re: View code

Post by bknight »

OK, Thanks

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

Re: View code

Post by bknight »

This may or may not be a stupid question. This thread was initiated because of an error message that the file could not be found. Well the HD is different, so I "found" it and "found" were in the Db it was linked and changed to the new link. Since the form is loaded at startup, I shut down the Db and restarted after correcting the link. Guess what? Nothing worked, so I deleted the linked worksheets and re-linked them. Everything worked yesterday after doing all that work.

Today I get an error message to input all of the manually input items in the Sql statement. So, I again deleted the linked table and then re linked them, just like I did yesterday. All is well the forms ran without error and I'm happy but perplexed.
Can you explain the behavior I was today i.e. the query can't "find" the items but after re-linking the spreadsheets it "finds" them? Remembering all that worked yesterday.

Code: Select all

SELECT Sheet1.[Ex Date] AS [Next Ext Date], Sheet1.Symbol, Sheet1.Company, Sheet1.Dividend, Sheet1.[Pay Date] AS [Next Pay Date], Sheet2.[Dividend Yield] AS Yield, Sheet3.Volume AS [Avg Vol]
FROM (Sheet3 LEFT JOIN Sheet2 ON Sheet3.Symbol = Sheet2.[Symbol]) LEFT JOIN Sheet1 ON Sheet2.[Symbol] = Sheet1.Symbol
WHERE (((Sheet1.[Ex Date])>Now() And (Sheet1.[Ex Date]) Is Not Null) AND ((Sheet2.[Dividend Yield])>0.03) AND ((InStr(1,[Sheet2].[Company Name],"ADR",1))="0"))
ORDER BY Sheet1.[Ex Date], Sheet1.Symbol;


User avatar
HansV
Administrator
Posts: 73871
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: View code

Post by HansV »

Has the content of the worksheets been changed in between?
Regards,
Hans

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

Re: View code

Post by bknight »

Only pieces like from tomorrow's date until 7 Jan 22. But not header changes, just data on Sheet1 daily.

User avatar
HansV
Administrator
Posts: 73871
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: View code

Post by HansV »

I'm afraid I cannot explain it, sorry...
Regards,
Hans

bknight
5StarLounger
Posts: 834
Joined: 08 Jul 2016, 18:53

Re: View code

Post by bknight »

That's exactly why I'm perplexed, it doesn't make sense.
Thanks anyway.