Last edited by bregtvandenbergh; 12-21-2016 at 01:00 PM.
you may have a filter on.
is the filtler button pressed down on the toolbar?
did you open the form via criteria with a KeyID?
It's not filtered and it is a detail of a form with all the items in it.
Sorry but it is the first thing i make with access.
This is the macro i use to open the detail of a certain item:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><UserInterfaceMacro For="txtOpen" Event="OnClick"><Statements><Action Name="OnError"/><ConditionalBlock><If><Condition>[Form].[Dirty]</Condition><Statements><Action Name="RunMenuCommand"><Argument Name="Command">SaveRecord</Argument></Action></Statements></If></ConditionalBlock><ConditionalBlock><If><Condition>[MacroError].[Number]<>0</Condition><Statements><Action Name="MessageBox"><Argument Name="Message">=[MacroError].[Description]</Argument></Action><Action Name="StopMacro"/></Statements></If></ConditionalBlock><Action Name="OnError"><Argument Name="Goto">Fail</Argument></Action><Action Name="OpenForm"><Argument Name="FormName">Item Details</Argument><Argument Name="WhereCondition">="[ID]=" & Nz([ID],0)</Argument><Argument Name="WindowMode">Dialog</Argument></Action><ConditionalBlock><If><Condition>Not IsNull([ID])</Condition><Statements><Action Name="SetTempVar"><Argument Name="Name">CurrentID</Argument><Argument Name="Expression">[ID]</Argument></Action></Statements></If></ConditionalBlock><ConditionalBlock><If><Condition> IsNull([ID])</Condition><Statements><Action Name="SetTempVar"><Argument Name="Name">CurrentID</Argument><Argument Name="Expression">Nz(DMax("[ID]",[Form].[RecordSource]),0)</Argument></Action></Statements></If></ConditionalBlock><Action Name="Requery"/><Action Name="SearchForRecord"><Argument Name="ObjectType">Form</Argument><Argument Name="ObjectName">Items</Argument><Argument Name="WhereCondition">="[ID]=" & [TempVars]![CurrentID]</Argument></Action><Action Name="RemoveTempVar"><Argument Name="Name">CurrentID</Argument></Action></Statements></UserInterfaceMacro></UserInterfaceMacros>
1, that is unreadable,
2, can you not just open the form,then have the user goto the record?
3, does the above code limit the records?
Sorry for the readability,
when i have to adjust items it is easier to have a next and previous button.
this is the code i use now:
Option Compare Database
Option Explicit
Private Sub cmdVorigRecord()
On Error Resume Next
DoCmd.GoToRecord , , acPrevious
End Sub
Private Sub cmdFirst_Click()
On Error Resume Next
DoCmd.GoToRecord , , acFirst
End Sub
Private Sub cmdLast_Click()
On Error Resume Next
DoCmd.GoToRecord , , acLast
End Sub
Private Sub cmdNew_Click()
On Error Resume Next
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub cmdVolgendRecord()
On Error Resume Next
DoCmd.GoToRecord , , acNext
End Sub
Private Sub Volgende_Record_Label_Click()
End Sub
Private Sub Form_Current()
End Sub
Private Sub VolgendeRecord_Label_Click()
End Sub
Private Sub VorigRecord_Click()
End Sub
The font on your picture is a bit small, but doesn't it say "Gefilterd" at the bottom? My Dutch is pretty nonexistent but I would assume that means that this form has a filter on it!
The screenshot was taken when it was filtered. i tried it when the filter was off.
sorry indeed the field is filtered. but how can i disable the filtering automatically?
Thanks
When a form has "1 of 1", there are two things I look at:
1) the form is in "Data Entry" mode
2) the SQL recordset has criteria, or there is a filter set on the recordset.
You said you removed a filter... what is the record source?
Is the form in data entry mode?
i still work with macro's.
so when i open the item detail it says at the bottom 1 of 1 and filtered.
so i adjusted the macro from:
--> GoToNextRecord
to:
--> Erase all filtres
--> GoToNextRecord
this seems to work without any problem.
then i copied the buttons to my contact detail page.
here it gives me the error that there is no filter to be removed.
it doesn't give this error with the item detail page.
so this is a new problem i encountered.
BTW i'm verry new to this...
kind regards
I don't work with macros so I have no idea how to fix that error. If you convert it to VBA you can add a line at the beginning: On Error Resume Next, this will prevent the error from happening. Maybe you can do this in a macro, I don't know.
Now it works like a charm.
thanks to everybody.
i wish everyone a merry christmas and a happy newyear.
kind regards,
bregt