Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Pages

Status
Not open for further replies.

blindlemonray

Technical User
Nov 24, 2003
130
GB
Does anyone know if you can use controls on Pages like you can on Forms? i.e.

If Me.functions = "no" Then
Me.Text.SetFocus.... blah blah

Thanks in advance

[bigglasses]
 
Yes.
Since your question is rather vague with a specific, I'll supply my own example. Let's say you have a textbox for the user to type in an Id or password. In design view, you would right click the textbox, select Microsoft Script Editor. On the left of the screen, under Script Outline, you'd scroll down to the textbox name and double click on it. You'll see some events. You would then double click on "onchange" and type in some code such as:

Set rs = CreateObject("ADODB.Recordset")
sqlSelect = _
"SELECT * FROM LogonInfo WHERE EmployID = '" & EmployeeID.value & "'"
rs.Open sqlSelect, MSODSC.Connection
If rs.EOF Then
EmployeeID.value = "(Access Denied)"
Else
holdID = document.all.item("EmployeeID").value
EmployeeID.value = "(You May Edit)"
Hyperlink0.style.visibility = "visible"
If holdID = "Whatever" then
Hyperlink1.style.visibility = "visible"
Hyperlink2.style.visibility = "visible"
txtStart.style.visibility = "visible"
txtEnd.style.visibility = "visible"
Text0_Label.style.visibility = "visible"
Text1_Label.style.visibility = "visible"
End if
End If
rs.Close
Set rs = Nothing

You code DAP's using VBScript, not what you use for forms. Remember, you are not in Access, you are in Internet Explorer.
 
Hi Fneily,

That is fantastic.. thank you [2thumbsup]. Hopefully it should not be too difficult to sort out.

My first example was something that I needed to do. Moving focus from one control to another depending on what first control is updated to i.e

If Me.dropdownlist = "no" Then
Me.anotherdropdownlist.SetFocus

Is the coding very similar?

Can you recommend any good sites for a bit of self teaching?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top