fEnableNextInTab()

timothyl

Registered User.
Local time
Today, 17:41
Joined
Jun 4, 2009
Messages
92
This code or built in function is used in a form I found by googling :

fEnableNextInTab()

I tried googling its meaning and how to use it, nothing at all clear came up. If any one could give me some insight on it I would appriciate it. Thanks
 
That appears to be a user defined function. What does the form deal with and where did you find it?
 
This code or built in function is used in a form I found by googling :

fEnableNextInTab()

I tried googling its meaning and how to use it, nothing at all clear came up. If any one could give me some insight on it I would appriciate it. Thanks

Right click on it and select Definition and Access will take you to the function if it is in the database.
 
Missingling, SOS. Missingling was on target, it is a coded function from a search form that builds a dynamic SQL statement and shows the results in a subform(The Access Web (http://home.att.net/~dashish)). I am building one of my own and thought I could use this function, if I understand it correctly(a big if) it collects the input from the filled in text, combo and check boxes. This form is professionally done and coded way over my head, so I geuss I'm not asking a question anymore as retro fiting this to my form is over my head. Thank you both for responding





Function fEnableNextInTab()
'Enable and Setfocus to the next control
'in the form's TabIndex.
Dim ctlNew As Control, intTab As Integer
Dim ctlOld As Control, intNewTab As Integer

On Error Resume Next
'Since we're calling this function from AfterUpdate,
'what's the current control's position in TabIndex
Set ctlOld = Screen.ActiveControl
'we want the next one
intNewTab = ctlOld.TabIndex + 1

For Each ctlNew In Me.Controls
intTab = ctlNew.TabIndex
If Not Err And (intTab = intNewTab) Then
'if no error occurred and the tab index is same as
'what we're looking for, then enable it
With ctlNew
'Store the control's name for later use
'but exclude the listbox since the tag there
'contains the number of fields in the object select
If Not ctlOld.ControlType = acListBox Then _
ctlOld.Tag = .Name
Select Case .ControlType
Case acListBox:
Case acComboBox:
'If the control found is a combo, fill it's rowsource
Call sFillCombo(Right(.Name, 1))
Case Else:

End Select
.Enabled = True
.Locked = False
.BackColor = vbWhite
.SetFocus
Exit For
End With
End If
Next
Set ctlOld = Nothing
Set ctlNew = Nothing
'Build the SQL automatically only if the user specified so
If Me.chkAutoBuildSQL = True Then Call sBuildSQL
End Function

And

Private Sub sFillCombo(intTargetIndex As Integer)
'Fills the Rowsource for a combo
'
On Error GoTo ErrHandler
Dim i As Long
Dim j As Integer
Dim strOut As String
Dim ctlTarget As Control
'Which one to fill?
Set ctlTarget = Me("cbxFld" & intTargetIndex)
For i = LBound(mvarOriginalFields) To UBound(mvarOriginalFields)
strOut = strOut & mvarOriginalFields(i) & ";"
Next
With ctlTarget
.RowSourceType = "Value List"
.RowSource = strOut
End With
ExitHere:
Set ctlTarget = Nothing
Exit Sub
ErrHandler:
Resume ExitHere
End Sub
 

Users who are viewing this thread

Back
Top Bottom