Record search bar at bottom of form

jpl458

Well-known member
Local time
Yesterday, 21:49
Joined
Mar 30, 2012
Messages
1,181
I created a data entry form from a table. When I first created the form and added some data, I could scroll through that dat using the record bar at the bottom of the form, which looks like this:

1662571949310.png


After making cosmetic changes that bar no longer allows me to cruise through the data one record at a time, and each time I hit either next or previous it creates a blank record in the table. I had the form set to
Code:
DoCmd.GoToRecord record:=acLast
, so when the user opened the form they were ready to enter data. Since they they to change data in a record I would like to have the < > work. I am missing something simple, but can't find it.

Thanks
 
For me, acLast puts focus on last existing record, not new record row.

As I suggested in response to your Stackoverflow question, might provide your db for analysis. Follow instructions at bottom of my post.
 
Just curious, did you happen to change the setting for the Form's Data Entry property? What does it say now?
 
Data Entry is set to Yes. Maybe I'm expecting too much from this form. After data enter, the users may want to make changes to records in the table. I was thinking that they could use the same form for both purposes. Early on I tried to make changes via the data entry form and it worked, now I can't even see entered records. Do I need to have a different form for changes? A form that is not data entry but has the same record source and controls to move through the table, and be able to search for items in the table. Or am I carrying coals to Newcastle to have a separate form.
 
Data Entry is set to Yes. Maybe I'm expecting too much from this form. After data enter, the users may want to make changes to records in the table. I was thinking that they could use the same form for both purposes. Early on I tried to make changes via the data entry form and it worked, now I can't even see entered records. Do I need to have a different form for changes? A form that is not data entry but has the same record source and controls to move through the table, and be able to search for items in the table. Or am I carrying coals to Newcastle to have a separate form.
As @June7 suggested, use acNewRec instead of acLast in your code.
 
Mystery solved! :)
As you can tell, I'm no expert at this, but it seem to me that the way you can change properties, and pretty much everything else, that you should be able to change the form to display and switch back to entry. I'm sure they don't do that because of other considerations. I'll just creat a new form. Thanks for a the help.
 
that you should be able to change the form to display and switch back to entry.
Maybe we did not understand you, since you definitely can switch between data entry view and all record view. To demo put a button on any form and in the click event put.
Code:
Me.DataEntry = Not Me.DataEntry
This will toggle the form back and forth between data entry and all record view. Can you explain exactly how you would like it to work?
 
Just thought it over, and talked to a possible user, who said she would rather stay on the same screen and hit buttons to enter data or to search and make changes. That will require some more vba code, but there only be one screen to deal with for the users. I don't know what is the acceptable way of designing this, what is standard? Or is it freedom to do it the way you want because there is no standard.
 
As you can tell, I'm no expert at this, but it seem to me that the way you can change properties, and pretty much everything else, that you should be able to change the form to display and switch back to entry. I'm sure they don't do that because of other considerations. I'll just creat a new form. Thanks for a the help.
I never bothered with dataentry = yes, I just used the * button at the bottom of the form.
That is a very badly named property IMO as all you can do is ADD new records. Never what newbies think it does.
 
As you can tell, I'm no expert at this, but it seem to me that the way you can change properties, and pretty much everything else, that you should be able to change the form to display and switch back to entry. I'm sure they don't do that because of other considerations. I'll just creat a new form. Thanks for a the help.
Did you see my last post? (Post #7)
 
Maybe we did not understand you, since you definitely can switch between data entry view and all record view. To demo put a button on any form and in the click event put.
Code:
Me.DataEntry = Not Me.DataEntry
This will toggle the form back and forth between data entry and all record view. Can you explain exactly how you would like it to work?
Pretty much the way you described it. But, don't you need 2 lines of code to toggle back and forth. I have noticed that when you set the data entry property to NO the property no longer is in the list., does your snippet of code actually toggle back and forth? I understand going from data entry to not data entry, but don't see how it would toggle back if you hit the button again. Could you briefly explain that, eager to learn.
 
The data entry property is a true/false value.
The above could have been written as

Code:
If me.dataEntry = true then
  me.dataEntry = false
end if
If me.DataEntry = false then
  me.dataEntry = true
end if

Assume the data entry is True then the expression
Me.DataEntry = Not Me.DataEntry
would resolve to
Me.DataEntry = Not (True)
which resolves to
Me.DataEntry = False

If DataEntry is false then
Me.DataEntry = not me.DataEntry
resolves to
Me.dataEntry = Not (False)
resolves to
Me.dataEntry = True

These toggles can work with all boolean properties
Me.TxtBoxAbsenceReason.visible = me.absent
So if a person is checked absent then the absence reason text box shows visible, hides if not absent.
 
Maybe we did not understand you, since you definitely can switch between data entry view and all record view. To demo put a button on any form and in the click event put.
Code:
Me.DataEntry = Not Me.DataEntry
This will toggle the form back and forth between data entry and all record view. Can you explain exactly how you would like it to work?
Just tried it and it works. Really cool, but I don't understand how the code works both ways. Have to change the label on the button to indicate what mode it's in. Thanks.......
 

Users who are viewing this thread

Back
Top Bottom