f



Error looping through controls on form in Access 2003

This is the code under a command button -

Dim ctl As Control

For Each ctl In Me.Controls
    If ctl.BackColor <> RGB(255, 255, 255) Then
        ctl.BackColor = RGB(255, 255, 255)
    End If
Next ctl

The error says that the 'Object doesn't support this property or metho,
then it highlights the line above ctlBackColor.

How can I loop through the controls on a form to check the backcolor
and then set it?

TD

0
dlee4962 (60)
11/11/2005 3:21:37 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

13 Replies
314 Views

Similar Articles

[PageSpeed] 16

Some controls (such as command buttons) don't have a BackColor property, so 
you receive error 438 telling you that the property is not supported by that 
control.

To avoid that, you might trap the error and resume, or use a Select Case 
based on the Type of the control.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"TD" <dlee@adsi-sc.com> wrote in message 
news:1131679297.926338.255080@o13g2000cwo.googlegroups.com...
> This is the code under a command button -
>
> Dim ctl As Control
>
> For Each ctl In Me.Controls
>    If ctl.BackColor <> RGB(255, 255, 255) Then
>        ctl.BackColor = RGB(255, 255, 255)
>    End If
> Next ctl
>
> The error says that the 'Object doesn't support this property or metho,
> then it highlights the line above ctlBackColor.
>
> How can I loop through the controls on a form to check the backcolor
> and then set it?
>
> TD
> 


0
AllenBrowne (3681)
11/11/2005 4:13:40 AM
TD wrote:

> This is the code under a command button -
> 
> Dim ctl As Control
> 
> For Each ctl In Me.Controls
>     If ctl.BackColor <> RGB(255, 255, 255) Then
>         ctl.BackColor = RGB(255, 255, 255)
>     End If
> Next ctl
> 
> The error says that the 'Object doesn't support this property or metho,
> then it highlights the line above ctlBackColor.
> 
> How can I loop through the controls on a form to check the backcolor
> and then set it?
> 
> TD
> 

Taking from what Allen said, you could test the type

For Each ctl In Me.Controls
   If ctl.ControlType = acTextBox or ctl.ControlType = acLabel
     If ctl.BackColor <> RGB(255, 255, 255) Then
         ctl.BackColor = RGB(255, 255, 255)
     End If
   End If
Next ctl
0
oil (4047)
11/11/2005 6:36:18 AM
On Fri, 11 Nov 2005 06:36:18 GMT, Salad <oil@vinegar.com> wrote:

>TD wrote:
>
>> This is the code under a command button -
>> 
>> Dim ctl As Control
>> 
>> For Each ctl In Me.Controls
>>     If ctl.BackColor <> RGB(255, 255, 255) Then
>>         ctl.BackColor = RGB(255, 255, 255)
>>     End If
>> Next ctl
>> 
>> The error says that the 'Object doesn't support this property or metho,
>> then it highlights the line above ctlBackColor.
>> 
>> How can I loop through the controls on a form to check the backcolor
>> and then set it?
>> 
>> TD
>> 
>
>Taking from what Allen said, you could test the type
>
>For Each ctl In Me.Controls
>   If ctl.ControlType = acTextBox or ctl.ControlType = acLabel
>     If ctl.BackColor <> RGB(255, 255, 255) Then
>         ctl.BackColor = RGB(255, 255, 255)
>     End If
>   End If
>Next ctl

Checking the error makes the code less couples to what exactly supports a
background color.  Your example, for instance, doesn't support box controls,
and new versions of Access may add controls that may or may not support a
background color.  The fewer details about something else your code needs to
consider, the better.
0
nospam48 (2784)
11/11/2005 8:26:59 AM
Steve Jorgensen wrote:
> On Fri, 11 Nov 2005 06:36:18 GMT, Salad <oil@vinegar.com> wrote:
> 
> 
>>TD wrote:
>>
>>
>>>This is the code under a command button -
>>>
>>>Dim ctl As Control
>>>
>>>For Each ctl In Me.Controls
>>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>>        ctl.BackColor = RGB(255, 255, 255)
>>>    End If
>>>Next ctl
>>>
>>>The error says that the 'Object doesn't support this property or metho,
>>>then it highlights the line above ctlBackColor.
>>>
>>>How can I loop through the controls on a form to check the backcolor
>>>and then set it?
>>>
>>>TD
>>>
>>
>>Taking from what Allen said, you could test the type
>>
>>For Each ctl In Me.Controls
>>  If ctl.ControlType = acTextBox or ctl.ControlType = acLabel
>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>        ctl.BackColor = RGB(255, 255, 255)
>>    End If
>>  End If
>>Next ctl
> 
> 
> Checking the error makes the code less couples to what exactly supports a
> background color.  Your example, for instance, doesn't support box controls,
> and new versions of Access may add controls that may or may not support a
> background color.  The fewer details about something else your code needs to
> consider, the better.

I wouldn't even bother with error codes.  A simple On Error Resume Next 
would suffice.  But there are times that it's nice to know what the 
ControlType is, so I provided an example to expand Allen's suggestions.
0
oil (4047)
11/11/2005 6:55:36 PM
On Fri, 11 Nov 2005 18:55:36 GMT, Salad <oil@vinegar.com> wrote:

>Steve Jorgensen wrote:
>> On Fri, 11 Nov 2005 06:36:18 GMT, Salad <oil@vinegar.com> wrote:
>> 
>> 
>>>TD wrote:
>>>
>>>
>>>>This is the code under a command button -
>>>>
>>>>Dim ctl As Control
>>>>
>>>>For Each ctl In Me.Controls
>>>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>>>        ctl.BackColor = RGB(255, 255, 255)
>>>>    End If
>>>>Next ctl
>>>>
>>>>The error says that the 'Object doesn't support this property or metho,
>>>>then it highlights the line above ctlBackColor.
>>>>
>>>>How can I loop through the controls on a form to check the backcolor
>>>>and then set it?
>>>>
>>>>TD
>>>>
>>>
>>>Taking from what Allen said, you could test the type
>>>
>>>For Each ctl In Me.Controls
>>>  If ctl.ControlType = acTextBox or ctl.ControlType = acLabel
>>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>>        ctl.BackColor = RGB(255, 255, 255)
>>>    End If
>>>  End If
>>>Next ctl
>> 
>> 
>> Checking the error makes the code less couples to what exactly supports a
>> background color.  Your example, for instance, doesn't support box controls,
>> and new versions of Access may add controls that may or may not support a
>> background color.  The fewer details about something else your code needs to
>> consider, the better.
>
>I wouldn't even bother with error codes.  A simple On Error Resume Next 
>would suffice.  But there are times that it's nice to know what the 
>ControlType is, so I provided an example to expand Allen's suggestions.

Just to be agumentative :)  I actually do pay attention to the error codes
because when all errors are treated the same, other errors that have
diagnostic value are obsucured.  I always check for just the error codes I
expect, and report or re-raise other errors.
0
nospam48 (2784)
11/11/2005 9:43:17 PM
Steve Jorgensen <nospam@nospam.nospam> wrote in
news:v04an1tqt17ugho9e7fegee0g7lpsi2hch@4ax.com: 

> On Fri, 11 Nov 2005 18:55:36 GMT, Salad <oil@vinegar.com> wrote:
> 
>>Steve Jorgensen wrote:
>>> On Fri, 11 Nov 2005 06:36:18 GMT, Salad <oil@vinegar.com> 
wrote:
>>> 
>>> 
>>>>TD wrote:
>>>>
>>>>
>>>>>This is the code under a command button -
>>>>>
>>>>>Dim ctl As Control
>>>>>
>>>>>For Each ctl In Me.Controls
>>>>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>>>>        ctl.BackColor = RGB(255, 255, 255)
>>>>>    End If
>>>>>Next ctl
>>>>>
>>>>>The error says that the 'Object doesn't support this property
>>>>>or metho, then it highlights the line above ctlBackColor.
>>>>>
>>>>>How can I loop through the controls on a form to check the
>>>>>backcolor and then set it?
>>>>>
>>>>>TD
>>>>>
>>>>
>>>>Taking from what Allen said, you could test the type
>>>>
>>>>For Each ctl In Me.Controls
>>>>  If ctl.ControlType = acTextBox or ctl.ControlType = acLabel
>>>>    If ctl.BackColor <> RGB(255, 255, 255) Then
>>>>        ctl.BackColor = RGB(255, 255, 255)
>>>>    End If
>>>>  End If
>>>>Next ctl
>>> 
>>> 
>>> Checking the error makes the code less couples to what exactly
>>> supports a background color.  Your example, for instance,
>>> doesn't support box controls, and new versions of Access may 
add
>>> controls that may or may not support a background color.  The
>>> fewer details about something else your code needs to consider,
>>> the better. 
>>
>>I wouldn't even bother with error codes.  A simple On Error 
Resume
>>Next would suffice.  But there are times that it's nice to know
>>what the ControlType is, so I provided an example to expand
>>Allen's suggestions. 
> 
> Just to be agumentative :)  I actually do pay attention to the
> error codes because when all errors are treated the same, other
> errors that have diagnostic value are obsucured.  I always check
> for just the error codes I expect, and report or re-raise other
> errors. 

I would *never* use an error handler to fix this. I'd simply make 
my
code apply only to the controltypes that I wanted it to apply to. 

INdeed, for this kind of thing, especially if it's running more
often than just when the form opens, I'd likely define a custom
collection. 

I prefer avoiding an error that is foreseeable, rather than
producing the error and then recovering from it. 

-- 
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc
0
dXXXfenton (2542)
11/12/2005 3:16:10 AM
On Fri, 11 Nov 2005 21:16:10 -0600, "David W. Fenton"
<dXXXfenton@bway.net.invalid> wrote:

....
>
>I would *never* use an error handler to fix this. I'd simply make 
>my
>code apply only to the controltypes that I wanted it to apply to. 
>
>INdeed, for this kind of thing, especially if it's running more
>often than just when the form opens, I'd likely define a custom
>collection. 
>
>I prefer avoiding an error that is foreseeable, rather than
>producing the error and then recovering from it. 

I have to wonder why...

I see 2 reasons to choose error handling over pre-checking conditions to avoid
exceptions.

1. The logic to check the condition and raise the appropriate error number to
communicate that condition is already built-in to VBA and the code libraries
accessed via VBA - why reinvent that wheel?  In fact, by reinventing the
wheel, you end up also reinventing the debugging it takes to get the condition
checks right, and you are now responsible for updating your checks to apply to
new cases of the same condition in new versions of the underlying libraries.

To put this more succinctly, why write code that has the complexity of
checking 4 or 5 control types that may not even be the right set of types in a
future version of the library when it could very simply check 1 error code
that should remain informative of the same condition across multiple versions
of the library.

2. There are cases where there is a finite risk that the condition being
checked can change between the time of the check and the time the code that
depends on the precondition runs.  Specifically, this can happen when checking
for duplicate rows before inserting, checking for the non-existence of files
before creating them, etc.

Using error handling, you get 2 for 1.  You catch the exception at the time of
the action that has the conflict, and identify what kind of conflict occurred.

---

Bottom line - what is so compelling about avoiding the use of exceptions for
information that is is worth writing more complex, more fragile code, more
tightly coupled to things you didn't write?

(yes - pots calling kettles black ... mea culpa)
0
nospam48 (2784)
11/12/2005 3:44:51 AM
Steve Jorgensen <nospam@nospam.nospam> wrote in
news:jloan1hj3kfkfs5lg8aet116k36lr4msq3@4ax.com: 

> On Fri, 11 Nov 2005 21:16:10 -0600, "David W. Fenton"
><dXXXfenton@bway.net.invalid> wrote:
> 
> ...
>>
>>I would *never* use an error handler to fix this. I'd simply make 
>>my
>>code apply only to the controltypes that I wanted it to apply to. 
>>
>>INdeed, for this kind of thing, especially if it's running more
>>often than just when the form opens, I'd likely define a custom
>>collection. 
>>
>>I prefer avoiding an error that is foreseeable, rather than
>>producing the error and then recovering from it. 
> 
> I have to wonder why...
> 
> I see 2 reasons to choose error handling over pre-checking
> conditions to avoid exceptions.
> 
> 1. The logic to check the condition and raise the appropriate
> error number to communicate that condition is already built-in to
> VBA and the code libraries accessed via VBA - why reinvent that
> wheel?  In fact, by reinventing the wheel, you end up also
> reinventing the debugging it takes to get the condition checks
> right, and you are now responsible for updating your checks to
> apply to new cases of the same condition in new versions of the
> underlying libraries. 

???

You've lost me. Sounds like you're saying to depend on a VBA error
rather than my method of only running the code on the controls to
which it applies. 

> To put this more succinctly, why write code that has the
> complexity of checking 4 or 5 control types that may not even be
> the right set of types in a future version of the library when it
> could very simply check 1 error code that should remain
> informative of the same condition across multiple versions of the
> library. 

Well, I tend to believe that error handling is more expensive in
terms of CPU cycles than checking controltypes. Also, I don't trust
VBA when it's in error mode. Things don't always go as one
expects,so I'd rather not get into that mode if I can avoide it. 

> 2. There are cases where there is a finite risk that the 
condition
> being checked can change between the time of the check and the
> time the code that depends on the precondition runs. 
> Specifically, this can happen when checking for duplicate rows
> before inserting, checking for the non-existence of files before
> creating them, etc. 

Well, if you change the scenario, then the balance between the
alternative methods of handling the problem changes. 

> Using error handling, you get 2 for 1.  You catch the exception 
at
> the time of the action that has the conflict, and identify what
> kind of conflict occurred. 

Well, that programming style goes against my grain. I dpn't let my
code generate errors that I'm aware of. To me, it's like prentative
medicine. 

> Bottom line - what is so compelling about avoiding the use of
> exceptions for information that is is worth writing more complex,
> more fragile code, more tightly coupled to things you didn't
> write? 

I don't see that the code is more complex, especially given that 
the
error handler requires either a GoTo, or Resume Next, the former of
which is unnecessarily complicated (in my opinion) and the lateter
of which is flat out dangerous to use, and in my opinion should
never be used if there is an alternative. 

Also, code that checks for the conditions that could produce the
error is likely to be better thought out, becuase in order to write
that code you have to consider what you need to check for. 

-- 
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc
0
dXXXfenton (2542)
11/13/2005 2:02:21 AM
Steve Jorgensen wrote:
> On Fri, 11 Nov 2005 21:16:10 -0600, "David W. Fenton"
> <dXXXfenton@bway.net.invalid> wrote:
>
> ...
> >
> >I would *never* use an error handler to fix this. I'd simply make
> >my
> >code apply only to the controltypes that I wanted it to apply to.
> >
> >INdeed, for this kind of thing, especially if it's running more
> >often than just when the form opens, I'd likely define a custom
> >collection.
> >
> >I prefer avoiding an error that is foreseeable, rather than
> >producing the error and then recovering from it.
>
> I have to wonder why...
>
> I see 2 reasons to choose error handling over pre-checking conditions to avoid
> exceptions.
>
> 1. The logic to check the condition and raise the appropriate error number to
> communicate that condition is already built-in to VBA and the code libraries
> accessed via VBA - why reinvent that wheel?  In fact, by reinventing the
> wheel, you end up also reinventing the debugging it takes to get the condition
> checks right, and you are now responsible for updating your checks to apply to
> new cases of the same condition in new versions of the underlying libraries.
>
> To put this more succinctly, why write code that has the complexity of
> checking 4 or 5 control types that may not even be the right set of types in a
> future version of the library when it could very simply check 1 error code
> that should remain informative of the same condition across multiple versions
> of the library.

You shouldn't have to worry about new types of controls until you
actually start using them.  The safety net (exception) is there to
catch :-) what falls through the cracks after you've done everything
you can to prevent errors from happening in the first place.  You made
a good point about considering that libraries can change in the future
but that consideration is not as strong as it would be without MS'
efforts to maintain some backward compatibility.  I don't mind a little
bit of extra code that prevents an error from happening 99.999 percent
of the time.  If you prevent the usual one or two obvious situations
the remaining cases are often rare and not worthy of reinvention.
Besides, checking for the existence of a file or of an indexed field
doesn't need much debugging.

>
> 2. There are cases where there is a finite risk that the condition being
> checked can change between the time of the check and the time the code that
> depends on the precondition runs.  Specifically, this can happen when checking
> for duplicate rows before inserting, checking for the non-existence of files
> before creating them, etc.

Now those are the exceptional cases that the word exception implies.  I
can live with the VBA error handler when a file whose existence I
checked a moment ago got deleted a score of milliseconds later.  Not
even checking to see if the file is there and relying on the error
handler is a different style entirely.  Trying to use the error handler
where you don't need it is like using the debugger to search and
replace a new variable name.  So I guess I'm suggesting a combination
of both error prevention and error handling for extremely rare cases,
yet the situation I'm in usually allows me to forego VBA error handling
entirely (my bad).

>
> Using error handling, you get 2 for 1.  You catch the exception at the time of
> the action that has the conflict, and identify what kind of conflict occurred.
>
> ---
>
> Bottom line - what is so compelling about avoiding the use of exceptions for
> information that is is worth writing more complex, more fragile code, more
> tightly coupled to things you didn't write?
>
> (yes - pots calling kettles black ... mea culpa)

Maybe I bought into that "ounce of prevention" line too much :-).  My
mathematician background always causes me to seek airtight solutions
but I can't get airtight solutions when so many unexpected things are
possible; so my engineering background causes me to try to get as close
to the ideal as possible even if it means checking some things that
others don't bother with.  Of course you have to consider how much time
the extra check takes.  I've never had a situation where I could not
find a way to make the extra check fairly quickly.  A good argument
might convince me to try error handling for duplicates.  If someone
wants to skip the extra check because it saves some time and gives the
user a quicker response then the error handling for the non-rare case
is there for a reason.  If you're concerned that MS is not going to
continue backward compatibility and you want more robust code that will
not have to be rewritten for new versions then that is a reason.  Note
that checks that use common API functions seem to be pretty reliable
for future versions.  I try not to use checking techniques that are
version fragile.  So have a reason for what you do either way.

James A. Fortune

0
jimfortune (501)
11/13/2005 2:26:13 AM
On Fri, 11 Nov 2005 19:44:51 -0800, Steve Jorgensen <nospam@nospam.nospam>
wrote:

....
>1. The logic to check the condition and raise the appropriate error number to
>communicate that condition is already built-in to VBA and the code libraries
>accessed via VBA - why reinvent that wheel?  In fact, by reinventing the
>wheel, you end up also reinventing the debugging it takes to get the condition
>checks right, and you are now responsible for updating your checks to apply to
>new cases of the same condition in new versions of the underlying libraries.
>
>To put this more succinctly, why write code that has the complexity of
>checking 4 or 5 control types that may not even be the right set of types in a
>future version of the library when it could very simply check 1 error code
>that should remain informative of the same condition across multiple versions
>of the library.

Perhaps an example is in order...

Let's say, we want a collection of all the control values on a form keyed by
control name, and we try the approach of checking the type of each control to
see if it's one we know should have a Value property.  Let's assume we're
fairly naive or fairly tired, so we get the obvious cases, but initially miss
some slightly non-obvious cases that we'll have to find during testing or when
they break later.

Public Function ControlValues(Form As Access.Form) As VBA.Collection
    Dim colResult As New VBA.Collection
    
    Dim ctlItem As Access.Control
    Dim varValue As Variant
    For Each ctlItem In Form.Controls
        If TryGetControlValue(ctlItem, varValue) Then
            colResult.Add Key:=ctlItem.Name, _
                          Item:=varValue
        End If
    Next
    
    Set ControlValues = colResult
End Function

Private Function TryGetControlValue( _
    Control As Access.Control, _
    ByRef Value As Variant _
) As Boolean
    Dim blnResult As Boolean
    
    If Control.ControlType = acTextBox Then
        blnResult = True
    ElseIf Control.ControlType = acComboBox Then
        blnResult = True
    ElseIf Control.ControlType = acCheckBox Then
        blnResult = True
    End If
    
    If blnResult Then
        Value = Control.Value
    End If
    
    TryGetControlValue = blnResult
End Function

.... Ok, so let's say we do some testing and figure out some Access control
types we missed that have Value properties, and we fix that...

    If Control.ControlType = acTextBox Then
        blnResult = True
    ElseIf Control.ControlType = acComboBox Then
        blnResult = True
    ElseIf Control.ControlType = acCheckBox Then
        blnResult = True
    ElseIf Control.ControlType = acOptionGroup Then
        blnResult = True
    ElseIf Control.ControlType = acListBox Then
        blnResult = True
    ElseIf Control.ControlType = acToggleButton Then
        blnResult = True
    End If

.... A while later we try to use this on a form and get an error because it
turns out that a toggle button was used in an option group instead of free
standing on the form.  Hmm - guess we'd better check what happens with an
option button that's -not- in an option group too.  Yup - an option button can
have a value property if it's not in an option group...

    Select Case Control.ControlType
    Case acTextBox, acComboBox, acCheckBox, acOptionGroup, acListBox
    Case acToggleButton, acOptionButton
        blnResult = Not (TypeOf Control.Parent Is Access.OptionGroup)
    End Select

.... There, is our code bullet proof yet?  What about ActiveX controls (e.g.
the FMS controls for Access)?  As I recall, some of them have Value
properties, and some don't.  How should we find out?  I guess we can cycle
through the properties list of each ActiveX control.  And is that all?  I
don't feel certain there's nothing else I've missed.  Can I ever know if I've
thought of everything?

On the other hand, if I just ask for a control's value, I'll either get a
value if it has one, or I'll get a trappable error if there isn't...

Private Function TryGetControlValue( _
    Control As Access.Control, _
    ByRef Value As Variant _
) As Boolean
   On Error GoTo Err_Catch
    
    Dim blnResult As Boolean
    
    Value = Control.Value
    blnResult = True
    
Proc_Final:
    TryGetControlValue = blnResult
    Exit Function

Err_Catch:
    If Err.Number = VB_ERR_MEMBER_NOT_SUPPTD Then
        blnResult = False
        Resume Proc_Final
    Else
        Err.Raise Err.Number, Err.Source, Err.Description, _
                  Err.HelpFile, Err.HelpContext
    End If
    
End Function

.... Yes, the error handling code is annoying, but we've restricted it to one
small procedure, and this might not have been the only reason to need an error
handler as the code evolves, so much of that code might have been unavoidable
in any case.
0
nospam48 (2784)
11/14/2005 6:41:00 AM
Steve Jorgensen <nospam@nospam.nospam> wrote in
news:6aagn1hou92tpck24euqabnftlhreh3rq1@4ax.com: 

> ... Yes, the error handling code is annoying, but we've restricted
> it to one small procedure, and this might not have been the only
> reason to need an error handler as the code evolves, so much of
> that code might have been unavoidable in any case.

I could construct any example I wanted if I design my code around
demonstrating whatever it is my argument happens to be. 

The code you've spent all that time writing is pretty much useless,
as there are much easier ways to accomplish the same thing. 

Your whole premise is that you're walking the entire controls
collection of the form. 

Remove that premise and your whole argument falls apart.

Use the .Tag property to group your controls and assign them to a
custom collection and your argument falls apart. 

If you limit the discussion to only one possible method for
accomplishing the task (i.e., always walking the entire controls
collection), yes, your error-based method is more efficient. 

But you can avoid that entirely by simply avoiding the problem in
the first place by not walking the control collection repeatedly. 

-- 
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc
0
dXXXfenton (2542)
11/14/2005 11:58:07 PM
On Mon, 14 Nov 2005 17:58:07 -0600, "David W. Fenton"
<dXXXfenton@bway.net.invalid> wrote:

>Steve Jorgensen <nospam@nospam.nospam> wrote in
>news:6aagn1hou92tpck24euqabnftlhreh3rq1@4ax.com: 
>
>> ... Yes, the error handling code is annoying, but we've restricted
>> it to one small procedure, and this might not have been the only
>> reason to need an error handler as the code evolves, so much of
>> that code might have been unavoidable in any case.
>
>I could construct any example I wanted if I design my code around
>demonstrating whatever it is my argument happens to be. 
>
>The code you've spent all that time writing is pretty much useless,
>as there are much easier ways to accomplish the same thing. 

For various values of "the same thing", that's probably true.

>Your whole premise is that you're walking the entire controls
>collection of the form. 
>
>Remove that premise and your whole argument falls apart.

And the original post was about trying to set the background color properties
of all the controls on a form.  I also have had many occasions to want to do
something to all applicable controls on a form, so it's not a fringe case.

>Use the .Tag property to group your controls and assign them to a
>custom collection and your argument falls apart. 

Yes, but that assumes the task at hand is best done by manually flagging the
controls in question rather than intelligently determining what do do without
the need for producing and maintaining a pattern of flagging.  For some tasks,
that's tru, and for others it isn't.

>If you limit the discussion to only one possible method for
>accomplishing the task (i.e., always walking the entire controls
>collection), yes, your error-based method is more efficient. 

Well, even with the Tag property, you have to walk the entire collection.

>But you can avoid that entirely by simply avoiding the problem in
>the first place by not walking the control collection repeatedly. 

Here's a case where I've needed to do something in line with the example I've
presented.

I had a bound form, and I needed to present freindly error messages to the
user in cases of certain errors during saving of new and edited records.  The
only way of doing this other than -not- editing or adding through the bound
form was to use a procedure that scans the values of the bound controls on the
form, cancels the save operation, then performs the add or update directly on
the form's recordset clone.

Significantly changing the design of each form was very undesirable because
there were about 40 forms (including subforms) affected, so I needed a generig
procedure that would examine the ControlSource and and Value properties of all
controls to figure out which ones supplied values to what fields in the
recordset.

This code took about a day and a half to write and implement (mostly because
of quirks with RecordsetClone in Access 2000 that went away in later
versions), and required adding only a few lines of code to each form in
question.
0
nospam48 (2784)
11/15/2005 5:48:46 AM
Steve Jorgensen <nospam@nospam.nospam> wrote in
news:g2tin1h5bude2segb3fl4uj9nd0j44dhv1@4ax.com: 

> On Mon, 14 Nov 2005 17:58:07 -0600, "David W. Fenton"
><dXXXfenton@bway.net.invalid> wrote:
> 
>>Steve Jorgensen <nospam@nospam.nospam> wrote in
>>news:6aagn1hou92tpck24euqabnftlhreh3rq1@4ax.com: 
>>
>>> ... Yes, the error handling code is annoying, but we've
>>> restricted it to one small procedure, and this might not have
>>> been the only reason to need an error handler as the code
>>> evolves, so much of that code might have been unavoidable in 
any
>>> case. 
>>
>>I could construct any example I wanted if I design my code around
>>demonstrating whatever it is my argument happens to be. 
>>
>>The code you've spent all that time writing is pretty much
>>useless, as there are much easier ways to accomplish the same
>>thing. 
> 
> For various values of "the same thing", that's probably true.

The task at hand is setting the background colors of selected
controls. See below for my reasoning why the way you're doing it is
wrong. 

>>Your whole premise is that you're walking the entire controls
>>collection of the form. 
>>
>>Remove that premise and your whole argument falls apart.
> 
> And the original post was about trying to set the background 
color
> properties of all the controls on a form.  I also have had many
> occasions to want to do something to all applicable controls on a
> form, so it's not a fringe case. 

But you don't have to walk the whole controls collection but once.

Look, I do this ALL THE TIME -- it's no accident that my stock
custom collections examples are based around that. The methods I 
use
don't involve checking the ControlType at all, even while 
populating
the custom collections. 

>>Use the .Tag property to group your controls and assign them to a
>>custom collection and your argument falls apart. 
> 
> Yes, but that assumes the task at hand is best done by manually
> flagging the controls in question rather than intelligently
> determining what do do without the need for producing and
> maintaining a pattern of flagging.  For some tasks, that's tru,
> and for others it isn't. 

I can't think of a case where it would not be a viable alternative.

>>If you limit the discussion to only one possible method for
>>accomplishing the task (i.e., always walking the entire controls
>>collection), yes, your error-based method is more efficient. 
> 
> Well, even with the Tag property, you have to walk the entire
> collection. 

But you don't have to check the ControlType, so there's nothing 
that
could go wrong. 

If you need to do different things to different types of controls,
you can set up different collections for each purpose, and any one
control can appear in more than one collection. 

Of course, I"m assuming certain things:

1. if you're setting background colors, you're doing it more than
once in each form session. Otherwise, you'd just set the colors in
design mode (well, I guess you might be doing this as some kind of
user configurable setting, but that's a complete waste of time as
far as I'm concerned). 

2. if you're doing it more than once, then you shouldn't be walking
the controls collection every single time you set the background
color. 

3. so, you will be using a custom collection in the first place, 
and
walk the collection only once, to get controls into the appropriate
collections. 

You may use ControlType or Tags (or some combination) to assign the
controls to the relevant collections, but you won't need to rely on
error handling, since there's nothing in that process that can 
raise
an error. 

Thus, by setting up your custom control, you've avoided the whole
problem and also vastly speeded up the real, human-perceivable
performance of your form. 

My point is that by choosing your methods right, you can design 
away
the whole problem we are arguing over, which is caused by walking
the entire controls collection and trying to do too many things in
one pass. 

>>But you can avoid that entirely by simply avoiding the problem in
>>the first place by not walking the control collection repeatedly. 
> 
> Here's a case where I've needed to do something in line with the
> example I've presented.
> 
> I had a bound form, and I needed to present freindly error
> messages to the user in cases of certain errors during saving of
> new and edited records.  The only way of doing this other than
> -not- editing or adding through the bound form was to use a
> procedure that scans the values of the bound controls on the 
form,
> cancels the save operation, then performs the add or update
> directly on the form's recordset clone.
> 
> Significantly changing the design of each form was very
> undesirable because there were about 40 forms (including 
subforms)
> affected, so I needed a generig procedure that would examine the
> ControlSource and and Value properties of all controls to figure
> out which ones supplied values to what fields in the recordset.
> 
> This code took about a day and a half to write and implement
> (mostly because of quirks with RecordsetClone in Access 2000 that
> went away in later versions), and required adding only a few 
lines
> of code to each form in question.

I'd create a custom collection, populate it in one pass through the
controls collection (checking the ControlType) and then run all my
tests around the custom collection. 

In other words, using the custom collection eliminates the need for
error recovery from attempting to check non-existent properties of
controls. 

I have a basic principle: never walk the controls collection of a
form more than once in any form session. The performance 
improvement
from using a custom collection is surprisingly noticeable, even 
with
forms that don't have hundreds of controls. 

-- 
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc
0
dXXXfenton (2542)
11/15/2005 8:44:09 PM
Reply:

Similar Artilces:

Running a ms access database with access 2003 in Vista
I have a Database that I am trying to run on a new vista computer. Up to now I was running it on a win 98 computer and using access 2003! I installed access 2003 and I can make it run and view the data but I can not save any new records. Has any one seen this problem yet? Thanks Clarence Wollman On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewollman@gmail.com> wrote: Do you have the same problem with the Northwind sample application? (search your computer for northwind.mdb) -Tom. >I have a Database that I am trying to run on a new vista computer. Up >to now I was running it on a win 98 computer and using access 2003! I >installed access 2003 and I can make it run and view the data but I >can not save any new records. >Has any one seen this problem yet? > >Thanks Clarence Wollman On Aug 22, 7:29 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote: > On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewoll...@gmail.com> > wrote: > > Do you have the same problem with the Northwind sample application? > (search your computer for northwind.mdb) I don't have a problem opening and editing the northwind.mdb. Thanks Hi I found a workaround. This database has a fronted and a backed. When I link them in the linked table manager, I was going threw the network to my computer. The reason I am doing this is when any networked computer opens the shortcut to the front end of this computer the linked table manger knows...

Sort form datasheet attempt crashes Access 2003 (error 3450-Access 2007)
'add one textbox to form1 with Control Source property = ID 'copy/paste the form_load code below: 'Then open the form and then attempt to sort the datasheet 'crashes 2003, error 3450 Access 2007 - I can't find much info on this... - Can someone explain what's happening and how to fix this? Private Sub Form_Load() '2008-01-11 Dim rsx As ADODB.Recordset Set rsx = New ADODB.Recordset rsx.CursorLocation = adUseClient rsx.CursorType = adOpenDynamic rsx.LockType = adLockOptimistic rsx.Fields.Append "ID", adDouble rsx.Open rsx.AddNew 0, 1 rsx.Update rsx.AddNew 0, 2 rsx.Update rsx.AddNew 0, 3 rsx.Update Set Form_Form1.Recordset = rsx End Sub curran.george@gmail.com wrote in news:36a9ad3f-5474-4995-b8e1- 9ec05b948e56@i29g2000prf.googlegroups.com: > 'add one textbox to form1 with Control Source property = ID > 'copy/paste the form_load code below: > 'Then open the form and then attempt to sort the datasheet > 'crashes 2003, error 3450 Access 2007 - I can't find much info on > this... - Can someone explain what's happening and how to fix this? > Private Sub Form_Load() > '2008-01-11 > Dim rsx As ADODB.Recordset > Set rsx = New ADODB.Recordset > rsx.CursorLocation = adUseClient > rsx.CursorType = adOpenDynamic > rsx.LockType = adLockOptimistic > > rsx.Fields.Append "ID", adDouble >...

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but...

View Access 2003 database in Access 2000
How can i view in Access 2000 a mdb created in Access 2003? rahulghai12@gmail.com wrote: > How can i view in Access 2000 a mdb created in Access 2003? > look here http://office.microsoft.com/en-ca/assistance/HP051863711033.aspx ...

How to copy form: Access 2003 to Access 97
Hi all, I have converted a database from Access 2003 to Access 97. Everything gets neatly imported into the new database except for one form which continues to show a fatal error when I try to open it in the new 97 database: "Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience. If you were in the middle of something, the information you were working on might be lost. For more information about this error, click here ___." This is a form that I am using as a sub-form on a parent form. The parent form is imported okay but no matter how many times and in how many different ways I try to get this sub-form into Access 97, it just won't work. Does anyone out there have any ideas on how I can get it into an Access 97 database without error so that I do not have to re-create it? Or why is this happening. Thank you. Carmela you can try SaveAsText, but I don't know if that'll work. Might need to bite the bullet and rebuild it. I found a work around and have the form in Access 97, but I am struggling with something else now :) Thanks for your input. C ...

MATLAB command to access MS Access database
Hi! Is there a MATLAB command which gives access to a .mdb MS Access database or do I need a special driver? Thanks, Andree Hi Andree Ellert, you can use activeXcontrol to interact with MS-Access database. access = actxserver('Access.Application'); returns the handle for Access. set(access, 'Visible', 1); will show the opened Access window. use get(access) and set(access) commands to find the methods available to call. -Vadivelu M =========== http://www.mathworks.com/access/helpdesk/help/toolbox/database/datatool.shtml "Andree Ellert" <ellert@gmx.net/////\\\\\> wrote in message news:eed9874.-1@webx.raydaftYaTP... > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree Andree Ellert wrote: > > > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4045&objectType=file> -Hardik ...

Access MS-ACCESS database on server from client????
I m currently developing a java based application and want to know how can i make client access database located on the server? "HeMan_Speaks" <Lunar20092010@gmail.com> wrote in message news:d71ce567-0434-48b8-b1d2-bb191706ab45@w8g2000prd.googlegroups.com... >I m currently developing a java based application and want to know how > can i make client access database located on the server? I think you're going to have to expand a little bit more in your question here, as is not 100% quite clear what you're trying to do. You might want to make a little bit of a distinction between MS access, the development system that allows you to write code, build forms, and build reports, and that of the database engine that you choose to use with MS access. When you build an application MS access, you then choose your database engine, that might be oracle, SQL server, or perhaps more often leave the default jet database. So when you say make a client access application, are you talking about a piece of software that you plan to install and each computer? The fact that your introducing the issue of java further complicates your question. Perhaps your question is simply you have some java code running on a server, and with to open a mdb file (an access database file). In this situation you're not really using MS access at all here (you using what is called the jet database engine to read that mdb file). For all the trouble in this type of sce...

request for explanation on access an database in ms access
This is the code that I found on the internet for accessing an ms access database: import java.sql.*; class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // set this to a MS Access DB you have on your machine String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end // now we can get the connection from the DriverManager Connection con = DriverManager.getConnection( database ,"",""); } catch (Exception e) { System.out.println("Error: " + e); } } } What I don't understand is the declaration of database. What I did was putting the database in the same dir as the sourcecode and use "jdbc:odbc:CafeJolt.mdb". But this doesn't work. And the above code does, why is that??? Actually it's not Java question. It's ODBC question. You have to have ODBC connection. Depending of Windows it's usually something like this (for my Windows 2000): Start->Sttings->Control Panel->Administartive Tools->Data Sources(ODBC)-> User DSN -> [Add]-> Driver to Microsoft Access(*.mdb) === And here, finally you can choose file name. ...

Access Controls in Access
How on access can you set access controls to your users? If they log in with one username and password they can just read information and if they log in with another username and password they can read and write? I have no idea how to do this, is it even possible?? Thank you Try playing with the access security tool, you can add users, groups, passwords, read/write allowances etc. to your database using that. Its under the 'Tools' menu of Access. Brian wrote: > Try playing with the access security tool, you can add users, groups, > passwords, read/write allowances etc. to your database using that. > Its under the 'Tools' menu of Access. Playing is not the proper word for it. I would never "play" with installing security without a backup copy of the System.mdw file or a backup of the application. You should also recommend the SecFaq when "playing" with security. http://www.mvps.org/access/resources/techpapers.htm. Dangerous http://www.youtube.com/watch?v=ASIVv_LiBoU Yeah i suppose playing wasn't the correct word for it. Hey Thanks for both your help. I'll try that. "Hanny J" <hannyjones@aol.com> wrote > Thanks for both your help. I'll try that. Note that a well-versed author and authority, Roger Jenkins, back in the days of Access 2.0, characterized Access' Security as "labrynthine". It has not gotten any less complex, and I caution that, while it is "doable&qu...

Making a form control the criteria for the sql statement of another control (Access 2003)
I have two comboboxes on a form. Combobox1 uses field1 in another table as its source of data. What I want to do is to enable combobox2 to use field2 in that table, but only to show the rows of data that contain the item selected in combobox1. At the moment I can easily write a SQL statement with a WHERE clause, but I only know how to specifiy static criteria. What I want is a variable criteria, where the criteria is the data contained in combobox 1. Is this possible? thanks for any help :) Ste "SteMc" <google@jasmonio.supanet.com> wrote >I have two comboboxes on a form. Combobox1 uses field1 in another table > as its source of data. What I want to do is to enable combobox2 to use > field2 in that table, but only to show the rows of data that contain > the item selected in combobox1. > > At the moment I can easily write a SQL statement with a WHERE clause, > but I only know how to specifiy static criteria. What I want is a > variable criteria, where the criteria is the data contained in combobox > 1. In the AfterUpdate event of ComboBox1, specify the Row Source of ComboBox2 as a SELECT query. So if the first combo selects the state, then the second combo of cities is filtered by that state: Private Sub cboState_AfterUpdate() Me!cboCity.RowSource = "SELECT city_id, cty_name FROM city WHERE city_state = ' " & Me!cboState & " ' " Me!cboCity.Requery End Sub -- Darryl Kerkeslager ...

Convert Access 2003 database file to Access 2010
How do you convert a Access 2002-2003 database file to a Access 2010 file format? According to Microsoft (http://office.microsoft.com/en-us/access-help/ convert-a-database-to-the-accdb-file-format-HA010341552.aspx? queryid=34ea405f95aa4cb8b8ffb2764afb4993&respos=0&CTT=1) it is possible. When I tried this on the file tab it only displays the print options only. How can I get the save, save & publish, and other commands to display? My 2002-2003 Access database file has 3 tables, 19 queries, 5 forms, and 16 reports. After I open the file up it gives the "Security Warning: Soame active content has been disabled. Click for more details." then there is a button "Enable Content". Before and after I click the "Enable Button" the file tab only has print options available. Thank you for your help, jfcby jfcby <jamesfc30@gmail.com> wrote in news:f4dc9993-afa3-4fed-8180-22786eaa7f83@l14g2000yql.googlegroups.co m: > How do you convert a Access 2002-2003 database file to a Access > 2010 file format? > > According to Microsoft > (http://office.microsoft.com/en-us/access-help/ > convert-a-database-to-the-accdb-file-format-HA010341552.aspx? > queryid=34ea405f95aa4cb8b8ffb2764afb4993&respos=0&CTT=1) it is > possible. When I tried this on the file tab it only displays the > print options only. > > How can I get the save, save & publish, and other commands to > display? ...

ACCESS accessibility from a C++ process launched from an ACCESS form
Here is my problem. From an ACCESS form, I run a C++ process reaching the same database in read/write mode via the ODBC driver. An error occurs: " The database has been placed by an unknown user in a state preventing it from being opened either locked. SQLSetConnectAttr failure of the pilot " (Nota : translated approximatively from the french error message). However, if I have used an another form before (eg. to modify a table), or if I have modified myself a record of any table, there is no problem. It seems that the database is in a state " read-only " by default until th...

Best way to access a remote MS ACCESS database
What is the best way, via the internet, to access a remote Microsoft Access database? I was thinking of using VPN, but I thought that I would check here to see if there is a better way. Any suggestions? Thanks Do you mean remotely controlling an Access database, or linking tables over the internet? The first is doable, the second is a recipe for disaster. Remote Control: If your remote OS is Windows XP, you can use Remote Desktop (although only 1 person can access the PC at a time; this will change in the upcoming Service Pack for XP, but that may not help you now). Otherwise, GoToMyPC offers similar services, as does Terminal Server (a component of a Windows Server machine), PCAnywhere, et al. Linking to remote tables: You will almost certainly encounter severe problems with corruption, and your performance will almost certainly be so poor as to be unworkable. I attempted this once, with a web server in Canada and my machine in Augusta, GA. Even tiny data requests on a very well optimized data structure took waaaay too long to process ... it's simply not workable, IMO. Other alternatives would be covert the app to a web-based and place your data on a web server. Access/Jet isn't really designed for those workloads, but running a small site with minimal transactions and users can be done. Otherwsie, consider switching to a more robust data platform like MySQL, SQL Server, etc. -- Scott McDaniel CS Computer Software Visual Bas...

Accessing MS ACCESS database using Data Environment
HI, I have developped a program in Visual Basic 6.0 using MS Access database. I have created all my reports through Data Environment where I have entered the location of my database file (for e.g c:\project\app\test.mdb) in the Connection properties. I have installed my application on another PC using Package & Deployment wizard. When viewing the reports on the other PC, I have to enter everytime the new location of the database. How can I solve this problem, please? nadia wrote: > HI, > I have developped a program in Visual Basic 6.0 using MS Access database. >...

Accessing a MS Access database across two servers
Hi The technical support guys at my company have set up my system so that the server containing the MS Access database is on one server, while the pages that should access the database are on another server. When the pages and database are on the same server, I usually just connect through ODBC. The problem is that I don't know how to set up an ODBC connection to link from one server to a database in another. Anyone know what I am getting at and know of a possible solution, or a link to a site which may help. thanks in advance Brendan "Singularity" <Brendan.Collins@Sin...

Import MS Office Excel Comma Separated Values Files into a MS Access 2003 database
Hi, I have been tasked with Importing MS Office Excel Comma Separated Values Files into a MS Access 2003 database. These files were exported from a DB2 database.I have also been given the DDL code. I have Googled a solution to this task and have tried creating these tables using the DDL code in a query within a blank MS Access database. Is there a more expedient way to achieve this? I noticed, for example, that a field in DB2 has a data type of "decimal" while the same field would have the data type of "number". Thanks, Zuf What follows is the DDL: -------...

Accessing a passworded MS Access 2000 database in Crystal Reports
Can anybody give me some code that I can put in to my VB6 app to open a passworded Access database in the Crystal Reports 8.5 RDC? I see so many examples - none of which seem to work for me. I am using a native connection in Crystal ( pdbdao.dll). My current code is : Dim Report As New crPrintPreview Dim crTable As CRAXDRT.DatabaseTable Private Sub Form_Load() Set crTable = Report.Database.Tables.Item(1) varpath = CurDir crTable.Location = varpath & "\OrderManager.mdb" CRViewer1.ReportSource = Report CRViewer1.ViewReport End Sub All I receive is the message "Error opening file xxxxxxx etc" and then "Open Database session failed" Appreciate any help! Peter Tyler ...

Using Iseries Access ODBC Driver with MS ACCESS 2003
When Trying attaching databases into MsAccess2003 using Iseries Access ODBC Driver (I'm in OS400 v5r2) I get an error message according to which the duration of connection is too long and so I can't attach the database although I got the list of the tables in the library I specified. Can anyone help me ? Thanks in advance. The timeout to dispay de data is small. You need to increase this timeout. The problem can occur when the tables are very very very (but very) big. "Bertrand Bard" <bbard@dehon.com> escribi� en el mensaje news:d01a5cc.0404280030.58f11d3e@posting.go...

access to Access
We use MS access 2000 at work and few people know how to work it including me. We are using it on a network and more than one person is trying to access it at once. Needless to say this isn't working as one has to log out first before another can enter data. Is there an easy way around this? Or a complicated way, actually I'll take anyway. Thanks Mike We have just started this database so any changes would be better done sooner. Mike Kelliher wrote: > We use MS access 2000 at work and few people know how to work it > including me. > We are using it on a network and more than one person is trying to > access it at once. Needless to say this isn't working as one has to > log out first before another can enter data. Is there an easy way > around this? Or a complicated way, actually I'll take anyway. > Thanks Mike > We have just started this database so any changes would be better done > sooner. It's highly recommended to have the database split with the data on the shared network drive and a copy of the frontend (forms/reports/etc) on each PC. You'll still get issues if people try to edit the same record for example. Also, you must make sure each user has permission to create new files on the network dive/folder where the MDB is located as Access dynamically creates an LDB file for record locking. If they can't create this file then Access reverts to single-user only. -- regards, Br@dley Br@dley wrote:...

Use of Access 2002-2003 structure in MS Access 2007
Dear reader, Is it possible to run in Access 2007 an application designed in Access 2002-2003 format? Tanks for any assistance. Kind regards and all the best for 2009 Simon ...

Accessing Access
Hello, what would be a good module for accessing data contained in a MS Access database file? Are there any examples of doing this that you know of? In article <nn1Ah.2617$2%1.2205@trndny02>, <QoS@domain.invalid.com> wrote: > >Hello, what would be a good module for accessing data contained in >a MS Access database file? Are there any examples of doing this >that you know of? Depends what kind of platform you can use. If you are under Windows, DBD::ODBC will work wonders. If you `bridge' Windows <-> Unix, you can set up a DBI::ProxyServer on a windows...

Forms/Subforms in MS Access Database
Why do my Forms/Subforms in my MS Access Database not appear? All I see is the boxes where they should show?! What did I do wrong? Thanks, John zufie wrote: > Why do my Forms/Subforms in my MS Access Database not appear? > > All I see is the boxes where they should show?! > > What did I do wrong? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Probably there isn't a name of a form in the sub-form's Source Object property. Also, the Link Child Fields and the Link Master Fields properties may be blank - you must enter the names of the link fields, they hold the field names that link the data between the forms. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSSsUjoechKqOuFEgEQL+dQCfYUSwXFtPj0RRSZO+q3J8lQCD0/UAniRz JKu0h9AG0BAg8W3wC/0BC7B3 =Kvva -----END PGP SIGNATURE----- On Nov 24, 2:54=A0pm, MGFoster <m...@privacy.com> wrote: > zufie wrote: > > Why do my Forms/Subforms in my MS Access Database not appear? > > > All I see is the boxes where they should show?! > > > What did I do wrong? > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Probably there isn't a name of a form in the sub-form's Source Object > property. =A0Also, the Link Child Fields and the Link Master Fields > properties...

Access 2003 database will not open using Access 2002
Hi everyone. I am trying to open a database which works fine using Access 2003, but when trying to open it on another PC that has Access 2002 I get the following error "This database is unrecognised file format, it may have been created with a later version of Access, upgrade to a later version..." Could anyone please help to resolve this issue. Many thanks. Joe. Use Access 2003 to decompile the database. To decompile, create a copy, and enter something like this at the command prompt while Access is not running. It is all one line, and include the quotes: "c:\Program Files\Microsoft office\office\msaccess.exe" /decompile "c:\MyPath\MyDatabase.mdb" Then compact the database to get rid of this junk: Tools | Database Utilities | Compact/Repair Although Access 2002 and 2003 share the same file format, each version of Access creates a different binary for the compiled code. What it's supposed to do it automatically discard the 2003 binary when you open the database in A2002, and create the new binary on the fly. In practice, this doesn't always work. The decompile explicitly discarding the binary, which usually solves the problem. This issue is common enough that IMHO, it is always worth decompiling when switching version, especially when reverting to an earlier version. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, r...

Is it possible to open an Access 2007 accdb database in Access 2003?
I understand that new features would not be available but is there any way I could open an accdb database in Access 2003? Robert Hi, Robert. >I understand that new features would not be available but is there any way >I could open an accdb database in Access 2003? Sorry. "Unrecognized database format." ACCDB's require Access 2007. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info. "Robert" <cpq1bcle@verizon.net> wrote in message news:S2O0i.38$eP6.33@newsfe06.lga... >I understand that new features would not be available but is there any way >I could open an accdb database in Access 2003? > > Robert > On Thu, 10 May 2007 19:25:51 -0400, "Robert" <cpq1bcle@verizon.net> wrote: Software rarely is forward compatible, and Access 2003 is no exception. Does your software anticipate the changes you'll make four years later? -Tom. >I understand that new features would not be available but is there any way I >could open an accdb database in Access 2003? > >Robert > "Robert" <cpq1bcle@verizon.net> wrote in news:S2O0i.38$eP6.33@newsfe06.lga: > I understand that new features would not be available but is there > any way I ...

Web resources about - Error looping through controls on form in Access 2003 - comp.databases.ms-access

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

From Armenia to Australia, how the mob controls the trafficking of ice into Australia
In America, they are called the "Five Families". The term refers to the five major New York organised crime families of the Mafia, with a history ...

From Armenia to Australia, how the mob controls the trafficking of ice into Australia
In America, they are called the "Five Families". The term refers to the five major New York organised crime families of the Mafia, with a history ...

From Armenia to Australia, how the mob controls the trafficking of ice into Australia
In America, they are called the &quot;Five Families&quot;. &nbsp;The term refers to the five major New York organised crime families of the Mafia, ...

How-To: Reduce iPhone screen brightness beyond what’s possible in Control Center or Display & Brightness ...
... about sharing in the past, involves reducing iPhone screen brightness beyond levels that are possible with the standard brightness slider controls. ...

Stagefright-based ‘Metaphor’ exploit can take control of your phone in just 15 seconds
The old Android malware beastie is at it again, with researchers uncovering a new Stagefright-based exploit that can be used to take control ...

Creative Control explores the dark side of augmented reality—with humor
... Here's what the future looks like: collecting data on people while wearing AR glasses. 7 more images in gallery In the film Creative Control ...

4 Ways to Control Your Mind and Lose Weight
... after a week of eating the same things. I have found that almost anytime I have plateaued, a cheat meal has broken the plateau. Gain Control ...

The Latest: Officers regain control of Alabama prison dorm
MONTGOMERY, Ala. (AP) — The Latest on the disturbances at a prison in Alabama where inmates have stabbed each other and prison authorities and ...

MIT, Harvard researchers push new way for users to control access to personal data
Cryptography researchers at MIT and Harvard have developed software called Sieve that is designed to help users keep track of encrypted personal ...

Resources last updated: 3/21/2016 6:48:54 AM