Hi,
To populate a subform, you need to create dynamically a query which will be set to the subform recordset as follow
qry = "SELECT Field... FROM .... WHERE 1 "
If Me.ListBox1.ListIndex <> -1 then
qry = qry & " AND field1 = ‘" & Me.listbox1.value & "’ "
end if
If Me.ListBox2.ListIndex...
Hi mort
A possible solution with parameter query
Create a storage procedure ( for this example myQuery) with parameter which will be called for populate your listboxB
PARAMETERS myParameter Long;
SELECT field1, field2, field3
FROM myTable
WHERE myId = myParameter
On Change event listboxA...
Thanks a lot again for your help.
I precise :
A payer (tblPayeur) can pay for several students (tblEleve).
Even if I trangress rules for modelling a db scheme, I store in an table (tblAEditer), students who have courses for a period MM/YYYY entered dynamically in a form which displays the list...
Hi Minty,
Using DISTINCT SQL command in subquery doesn’t cause truncation of memo field if it is selected in the principal request. For my case, it works perfectly:)
Hi All
It works great now
I applied recommendations provided by Allen’s Browne :
Move on first position the memo field
remove DISTINCT SQL command and change my query to select only one record by using SELECT memoField,.... FROM tblX WHERE tblX.id IN ( SELECT DISTINCT tblX.id FROM....)...
Hi Minty
In my vba code I wrote
sSQL = "SELECT * FROM qryPayeurPourEdition"
Set recSet = CurrentDb.OpenRecordset(sSQL)And qryPayeurPourEdition SQL is
SELECT DISTINCT tblPayeur.Afficher, tblPayeur.eMailComment, tblPayeur.eMail, tblPayeur.PaiementImediat, UCase([tblPayeur].[civilite] & " " &...
Hy Minty
Thanks for your help but still doesn't work and even after declaring my variable as below
Dim sBody As String * 1024
I used the function below to check sBody content and same result, only 255 charaters were saved in SQL.txt
Function writeInFile(sSQL As String)
sPath =...
Outlook.mailitem - How to assign to body a memo field with 255 characters & more
Hi
In a VBA function, I assign to the body of Outlook object a memo field with more than 255 characters
.Body = recSet!eMailCommentBut the memo field content is cut off after 255 characters.
How to circumvent...