"smk23" <smk23@discussions.microsoft.com>'s wild thoughts
were released on Thu, 30 Dec 2004 06:11:03 -0800 bearing the
following fruit:
>I knew this was going to be too "general" but wasn't sure how to state my
>question. Basically, I'm an Access person. A programmer was developing a form
[quoted text clipped - 10 lines]
>article, that's fine.
>Thank you.
Typically when not working with bound control (very sensible
IMO) you create a connection (ADODB.Connection) to the
database and store the data retrieved from the database in a
recordset (ADODB.Recordset)
Does this sound familiar given the code you've looked at?
J
>> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
>> were released on Thu, 30 Dec 2004 03:51:02 -0800 bearing the
[quoted text clipped - 10 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
"Henry the Eighth weighed over 300 pounds!" Tom stated unthinkingly.
(Stan Kegel)
[Abolish the TV License - http://www.tvlicensing.biz/]
smk23 - 30 Dec 2004 15:45 GMT
Yes, there is code to create the connection and retrieve the recordset. I
passed a variable (ClientID) to the module on the subform, but it's not
executing anything. I appears to be pulling a recordset of the entire db, not
selected records.
Here is the line creating the recordset:
.brSelectCommandText = "SELECT ocm.* FROM " & _
"dbo.OccMain ocm " & _
"WHERE ocm.ClientID = " & mlngClientID
oops! now I see that I haven't passed the value of mlngClientID. How do I do
that?
Sam
> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
> were released on Thu, 30 Dec 2004 06:11:03 -0800 bearing the
[quoted text clipped - 40 lines]
>
> Jan Hyde (VB MVP)
Jan Hyde - 30 Dec 2004 16:05 GMT
"smk23" <smk23@discussions.microsoft.com>'s wild thoughts
were released on Thu, 30 Dec 2004 07:45:10 -0800 bearing the
following fruit:
>Yes, there is code to create the connection and retrieve the recordset. I
>passed a variable (ClientID) to the module on the subform, but it's not
[quoted text clipped - 6 lines]
> "dbo.OccMain ocm " & _
> "WHERE ocm.ClientID = " & mlngClientID
ClientID is probably unique, and so the recordset would
contain one record containing all fields (pcm.*) for that
client ID
>oops! now I see that I haven't passed the value of mlngClientID. How do I do
>that?
Um? Yes you have, according to that SQL above. Assuming that
the passed in ClientId is stored in the variable
mlngClientID.
Are you familar with the fields on the table 'OccMain'?
Do you know how to access these fields in the recordset?
J
>Sam
>
[quoted text clipped - 42 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
The convicted architect discovered that prison walls were not made to scale. (Gary Hallock)
[Abolish the TV License - http://www.tvlicensing.biz/]
smk23 - 30 Dec 2004 15:59 GMT
I passed the value of ClientID and now I get a syntax error stating invalid
use of null. It appears that this is executing before the parent form
populates.
so close....... !
Sam
> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
> were released on Thu, 30 Dec 2004 06:11:03 -0800 bearing the
[quoted text clipped - 40 lines]
>
> Jan Hyde (VB MVP)
Jan Hyde - 30 Dec 2004 16:37 GMT
"smk23" <smk23@discussions.microsoft.com>'s wild thoughts
were released on Thu, 30 Dec 2004 07:59:04 -0800 bearing the
following fruit:
>I passed the value of ClientID and now I get a syntax error stating invalid
>use of null. It appears that this is executing before the parent form
>populates.
>so close....... !
> Sam
Post the line that gives the syntax error.
J
>> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
>> were released on Thu, 30 Dec 2004 06:11:03 -0800 bearing the
[quoted text clipped - 40 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
Belong: To take your time (Art. Moger)
[Abolish the TV License - http://www.tvlicensing.biz/]
smk23 - 30 Dec 2004 17:05 GMT
This code is on the subform. I get a error pointing to the 2nd line with
message "invalid use of null" when opening the main form.
Private Sub Form_Open(Cancel As Integer)
mlngAilmentID = Me.Parent.AilmentID
> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
> were released on Thu, 30 Dec 2004 07:59:04 -0800 bearing the
[quoted text clipped - 56 lines]
>
> Jan Hyde (VB MVP)
Jan Hyde - 30 Dec 2004 17:10 GMT
"smk23" <smk23@discussions.microsoft.com>'s wild thoughts
were released on Thu, 30 Dec 2004 09:05:02 -0800 bearing the
following fruit:
>This code is on the subform. I get a error pointing to the 2nd line with
>message "invalid use of null" when opening the main form.
>
>Private Sub Form_Open(Cancel As Integer)
>
>mlngAilmentID = Me.Parent.AilmentID
Yuk. I'd change the code to pass ID through to the child
form.
AilmentID cannot be a long value then since a long cannot be
NULL.
>> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
>> were released on Thu, 30 Dec 2004 07:59:04 -0800 bearing the
[quoted text clipped - 56 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
When the TV repairman got married, the reception was excellent.
(Pun of the Day)
[Abolish the TV License - http://www.tvlicensing.biz/]
smk23 - 30 Dec 2004 17:45 GMT
You'd take this code off the subform and put what in the main form? This is
my doing, the programmer didn't write the line below.
> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
> were released on Thu, 30 Dec 2004 09:05:02 -0800 bearing the
[quoted text clipped - 75 lines]
>
> Jan Hyde (VB MVP)
Jan Hyde - 31 Dec 2004 09:01 GMT
"smk23" <smk23@discussions.microsoft.com>'s wild thoughts
were released on Thu, 30 Dec 2004 09:45:04 -0800 bearing the
following fruit:
>You'd take this code off the subform and put what in the main form? This is
>my doing, the programmer didn't write the line below.
I'd give the Subform I ClientID property, in the main form I
would set my subform.ClientID = ClientID if you get my
meaning, anyway that's another issue. You need to look at
Me.Parent.AilmentID
Because this must be returning a null value.
>> "smk23" <smk23@discussions.microsoft.com>'s wild thoughts
>> were released on Thu, 30 Dec 2004 09:05:02 -0800 bearing the
[quoted text clipped - 75 lines]
>>
>> Jan Hyde (VB MVP)
Jan Hyde (VB MVP)

Signature
Justice: Only frozen water (Jan Hyde)
[Abolish the TV License - http://www.tvlicensing.biz/]
When you say SubForm are you referring to an Access type of form? (I think
Access has a special form called a SubForm).. If yes, then your questions
would be better posted in the Access programming newsgroup.

Signature
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
> I knew this was going to be too "general" but wasn't sure how to state my
> question. Basically, I'm an Access person. A programmer was developing a form
[quoted text clipped - 25 lines]
> >
> > Jan Hyde (VB MVP)