how to move to another cell to input values from a textbox

B

bo2loz el meba2laz

i have a visual basic code for an interface that contains 2 pushbuttons and 2
text boxes. the code for the one of the pushbuttons is as follows:
Private Sub CommandButton1_Click()

Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)


LastRow.Offset(13, 0).Value = TextBox1.Text
LastRow.Offset(13, 1).Value = TextBox2.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If


End Sub


in the second line of the program ive got 'End(xlUp)' which makes my second
input into the text boxes appear 10 cells below the first input. i want to
make my seecond input appear a cell below the first input. HOW ??????? :))
 
J

JimBurke via AccessMonster.com

This looks like a question you'd want to ask on the Excel programming forum -
this is an Access programming forum.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top