PC Review


Reply
Thread Tools Rate Thread

Another VBA checkbox/record question

 
 
Newboy
Guest
Posts: n/a
 
      18th Apr 2004
Hi, My database is coming along quite well but I have
another problem.
My continous form shows my Contacts with a button that
opens a popup window so that I can enter any orders, this
is now working well but I can't see from the Contacts
Form which contacts have Orders so I wanted to add a
checkbox that would be checked if that Contact had any
records in the Orders table.
I guess an Event Procedure linked to the Close button of
the Orders form would be best, something like if there
are any records for the Order then set a field in the
Contact table.
Please help, I have been trying all day and not got any
where at all.
 
Reply With Quote
 
 
 
 
Newboy
Guest
Posts: n/a
 
      18th Apr 2004
My problem is that on my Orders Form I can access the
fields on its subform
Access says it cant find the Form AgreementTrialSubform

Dim varDate As Variant
varDate = Forms!AgreementTrialSubform!REPORT_YEAR

 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      18th Apr 2004
Newboy wrote:

>My problem is that on my Orders Form I can access the
>fields on its subform
>Access says it cant find the Form AgreementTrialSubform
>
>Dim varDate As Variant
>varDate = Forms!AgreementTrialSubform!REPORT_YEAR



A subfrom is not a member of the Forms collection, which
consists only of forms that are opened directly to the
Access window.

Subforms are referred to through the subform control (on the
main form) that is displaying the form specified in its
SourceObject property.

varDate = Me.AgreementTrialSubform.Form!REPORT_YEAR

Note that the name of the subform control may be different
than the form that it is displaying, so double check the
subform control's name.
--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Newboy
Guest
Posts: n/a
 
      18th Apr 2004
Thanks,
This has helped me a lot, can I apply the same principle
to the VBA that is being used to open the Subform so that
the cursor can go straight to the first Control on the
Subform rather than the first control on the Form?

DoCmd.GoToControl Me.AgreementTrialSubform.Form!
REPORT_YEAR

>
>A subfrom is not a member of the Forms collection, which
>consists only of forms that are opened directly to the
>Access window.
>
>Subforms are referred to through the subform control (on

the
>main form) that is displaying the form specified in its
>SourceObject property.
>
>varDate = Me.AgreementTrialSubform.Form!REPORT_YEAR
>
>Note that the name of the subform control may be

different
>than the form that it is displaying, so double check the
>subform control's name.
>--
>Marsh
>MVP [MS Access]
>.
>

 
Reply With Quote
 
Newboy
Guest
Posts: n/a
 
      18th Apr 2004
I think I have don it:
Forms![AgreementTrials]![AgreementTrialSubform].SetFocus
DoCmd.GoToControl "REPORT_YEAR"

>-----Original Message-----
>Thanks,
>This has helped me a lot, can I apply the same principle
>to the VBA that is being used to open the Subform so

that
>the cursor can go straight to the first Control on the
>Subform rather than the first control on the Form?
>
>DoCmd.GoToControl Me.AgreementTrialSubform.Form!
>REPORT_YEAR
>
>>
>>A subfrom is not a member of the Forms collection, which
>>consists only of forms that are opened directly to the
>>Access window.
>>
>>Subforms are referred to through the subform control

(on
>the
>>main form) that is displaying the form specified in its
>>SourceObject property.
>>
>>varDate = Me.AgreementTrialSubform.Form!REPORT_YEAR
>>
>>Note that the name of the subform control may be

>different
>>than the form that it is displaying, so double check the
>>subform control's name.
>>--
>>Marsh
>>MVP [MS Access]
>>.
>>

>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to update a certain record with a checkbox TODDAV8R Microsoft Access Forms 1 9th Aug 2007 05:13 AM
Checkbox for each record justin.poole@gmail.com Microsoft Access 3 31st Aug 2006 01:00 AM
Checkbox on continuous form breaks navigation from record to record Yarik Mezheritsky via AccessMonster.com Microsoft Access Forms 0 2nd Jun 2005 06:49 AM
Checkbox per record Steve Microsoft Access Getting Started 6 5th Dec 2003 07:24 PM
Referencing next record for a checkbox Chad Microsoft Access Form Coding 0 14th Jul 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 AM.