I get blank form with VBA Why?

bmkol

Member
Local time
Today, 02:33
Joined
Dec 2, 2021
Messages
39
I'm doing a really simple task and have no idea why I get blank form when I try to open it from another form.

Here is the form when I open it not from another form:
1639996645383.png

The record source of this form is:
SELECT tblChidush.ChidushId, tblChidush.LoaziDate, tblChidush.HebDate, tblChidush.PasukId, tblSefer.Sefer, tblParasha.Parasha, tblPasuk.PerekNum, tblPasuk.PasukNum, tblPasuk.Pasuk
FROM (tblSefer INNER JOIN tblParasha ON tblSefer.SeferId = tblParasha.SeferId) INNER JOIN (tblPasuk INNER JOIN tblChidush ON tblPasuk.PasukId = tblChidush.PasukId) ON (tblParasha.ParashaId = tblPasuk.ParashaId) AND (tblSefer.SeferId = tblPasuk.SeferId)
WHERE (((tblChidush.PasukId)=10));

Now ... when I open the form from another form I use the from load event with this code:

Private Sub Form_Load()

Dim strSqlForm As String

strSqlForm = "SELECT tblChidush.ChidushId, tblChidush.LoaziDate, tblChidush.HebDate, tblChidush.PasukId, tblSefer.Sefer, tblParasha.Parasha, tblPasuk.PerekNum, tblPasuk.PasukNum, tblPasuk.Pasuk FROM (tblSefer INNER JOIN tblParasha ON tblSefer.SeferId = tblParasha.SeferId) INNER JOIN (tblPasuk INNER JOIN tblChidush ON tblPasuk.PasukId = tblChidush.PasukId) ON (tblSefer.SeferId = tblPasuk.SeferId) AND (tblParasha.ParashaId = tblPasuk.ParashaId) WHERE (((tblChidush.PasukId)=15));"

Me.RecordSource = strSqlForm

End Sub

The result is empty form
1639996954536.png


this is driving me crazy ... I have no idea why
 
you only use Inner Join if there is a matching record on
the other related table.

you can experiment by Using Left Join or Right Join
 
you only use Inner Join if there is a matching record on
the other related table.

you can experiment by Using Left Join or Right Join
I never heard about left or right join. What do you mean? Should I change something on my sql statment?
 
I solved my problem ... The reason I got blank form was becuase anytime there were no result of the sql statment the form was empty.
I'm so stupid sometimes.
 
Thanks! Any comment (good or bad) is always appreciated. Cheers!
I suggest you to add a page with link subjects of the codes you have that will make it easy to find issues that reply to users on your website.
I used your search on the website but a webpage with topics will also rank your website better.
 
I suggest you to add a page with link subjects of the codes you have that will make it easy to find issues that reply to users on your website.
I used your search on the website but a webpage with topics will also rank your website better.
Hi. Thank you so much for your suggestion. I think that's a very good idea. I'll definitely work on it the first chance I get after the Holidays!

Merry Christmas!!!
 
Hi. Thank you so much for your suggestion. I think that's a very good idea. I'll definitely work on it the first chance I get after the Holidays!

Merry Christmas!!!
You can bless me with Happy Hanuka ... I'm an Israeli (Jewish)....:LOL::LOL:
 

Users who are viewing this thread

Back
Top Bottom