Hi, Ricter.
I've been trying to code the On_Exit event of Value such that focus moves to
VendorInvNum.
The syntax is not intuitive. Assuming subInvoices is the name of the second
subform control (not Sub2), place the following code in the module of the
form used in the subTariffs subform control:
Private Sub Value_LostFocus()
On Error GoTo ErrHandler
Me.Parent!subInvoices.SetFocus
Me.Parent!subInvoices.Controls!VendorInvNum.SetFocus
Exit Sub
ErrHandler:
MsgBox "Error in Value_LostFocus( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Sub
Save and compile the code.
I really need help with this, some examples use brackets, others don't, etc.
Brackets are used to enclose identifiers with illegal characters or Reserved
words, such as the word "Value," to fix problems that will otherwise occur
when the Jet expression service tries to read them. Sometimes brackets fail
to fix the problem or even cause new problems, so they should never be used
by someone who doesn't have time to chase bugs. Avoid Reserved words and
only use alphanumeric characters and the underscore character for your
identifiers, and you won't waste time chasing bugs when the Jet expression
service misuses them. For lists of Reserved words to avoid, please see the
following Web pages:
http://support.microsoft.com/default.aspx?id=321266
http://support.microsoft.com/default.aspx?scid=286335
When reading this second page, pay particular attention to the myth on that
page because if you believe it, you will waste a lot of time chasing very
hard to find bugs that will teach you why it's not always true:
"For existing objects with names that contain reserved words, you can avoid
errors by surrounding the object name with brackets ([ ])."
I get two hours a week to work on this db, and I've blown a month just
trying to solve this navigation problem.
Be prepared to spend some of your own time to learn Access if you want to
become proficient with it.
Somehow, a Tab Control seems to
break Access's normal tab order...
Subform controls on tab controls seem to cause people problems -- and extra
work to manage them properly. Back in the days when people were using 15-
and 17-inch monitors where screen real estate was at a premium, tab controls
sure came in handy. These days with larger monitors and much higher
resolutions, much of the time when a tab control is necessary it's because
there are way too many controls or too much wasted space on the form. If
this application isn't being used on laptops, then consider whether a form
redesign would help make your life easier.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.