new record makes rows disappear above

  • Thread starter mbr96 via AccessMonster.com
  • Start date
M

mbr96 via AccessMonster.com

I have a simple form that has an On Open event that creates a new record.
When the form opens and there is more than one screen full of data (20+ rows),
the existing rows disappear above the new record, which sits at the top of
the screen. It looks like the list is blank, even though you can scroll up
to see existing rows (I want people to be able to do that so I have the Data
Entry property set to False, meaning they can look at existing rows and enter
new rows).

How can I get the existing data to display on the screen, with the cursor on
a new record at the bottom instead of a blank new row at the top with no
data showing?

MBR
 
L

Linq Adams via AccessMonster.com

There's probably a more elegant hack to do this, but this will work. Simply
adjust how many rows you want to show by changing the 4 in the line

For i = 1 To 4

to whatever number you want.

Private Sub Form_Load()
DoCmd.GoToRecord , , acLast

For i = 1 To 4
DoCmd.GoToRecord , , acPrevious
Next i

DoCmd.GoToRecord , , acNewRec
End Sub
 
M

mbr96 via AccessMonster.com

Thanks! That works fine, seems to show more than 4 rows even if I only put 1
to 4 in the code, but the point was simply to show some existing data and not
have the entire dataset hidden.

Clever stuff - thanks again.

Mbr
 

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