Hi by using the following
Me.PrivateAddress.SetFocus
Me.PrivateAddress.SelStart=0
Deletes the data in the field and gives a result of "0" or "-1"
How do I keep the data in the field and have the cursor ready to type in
the house name or number, giving one space between the words?
The following code puts the data into the field private address
Dim ExistingPCode As Variant
Dim ExistingSN As Variant
Dim ExistingSL As Variant
Dim ExistingTO As Variant
Dim ExistingCO As Variant
ExistingPCode = DLookup("[txtPCPostCode]", "tblPostCode",
"[txtPCPostCode]='" & Me.PostalCode & "'")
ExistingSN = DLookup("[txtPCStreetName]", "tblPostCode",
"[txtPCPostCode]='" & Me.PostalCode & "'")
ExistingSL = DLookup("[txtPCStreetLocation]", "tblPostCode",
"[txtPCPostCode]='" & Me.PostalCode & "'")
ExistingTO = DLookup("[txtPCTown]", "tblPostCode", "[txtPCPostCode]='" &
Me.PostalCode & "'")
ExistingCO = DLookup("[txtPCCounty]", "tblPostCode", "[txtPCPostCode]='"
& Me.PostalCode & "'")
If Not IsNull(ExistingPCode) Then
Me.Private_Address = ExistingSN
Me.Address = ExistingSL
Me.City = ExistingTO
Me.County = ExistingCO
End If
Me.Private_Address.SetFocus
Me.Private_Address.SelStart = 0
Thanks Bob
Michel Walsh said:
Hi,
Me.Text0.SetFocus
Me.Text0.SelStart=0
should do.
Hoping it may help,
Vanderghast, Access MVP
Hi I have data in an address field called CFAddress which has had the
data entered by a lookup process, when I tab back into the field
CFAddress all the data is highlighted. Is it possible to set the
cursor to the left of the field and the data moved over one space so
that I can enter the property name or number when I tab into the field.
As below.
21 Longfellow Road
Thanks Bob