Re: ID mixing with all records



Nick

Still seems like a "how" question ... how to programmatically remove the
OpenArgs. Please describe the "what"... what is it that you are trying to
accomplish. I ask because there may be more than one way to get your job
done...

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Nick X" <Nicknnator (no) @ (spam) aol.123com> wrote in message
news:725C469B-E7DB-400E-A9E2-78A08A2AA6E7@xxxxxxxxxxxxxxxx
OK, all the answer are staring me in the face today, and all I can do is
stare blankly back. The problem was with the :
Private Sub Form_Current()

If Not IsNull(Me.OpenArgs) Then
Me.JobID = Me.OpenArgs
End If

End Sub
I just didn't take the time to re-open the form after I commented out the
code.

Is it possible to programmatically remove the openargs?
Thanks,
NickX
"Jeff Boyce" wrote:

Nick

You've described the "how" ... now, how 'bout the "what". Since queries
and
forms and reports are all based on the underlying data, please describe
your
table structure and data types.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

"Nick X" <Nicknnator (no) @ (spam) aol.123com> wrote in message
news:7D4C56E1-06B8-4C4A-AC2E-F5BD6B00169A@xxxxxxxxxxxxxxxx
Hi all,
I am having an issue with my form when I apply a filter. The filter is
working as expected, until you look at the KeyID or the UtilityAlias
(Company
Name). The problem is that when you run this code:

Private Sub cboStreetNames_AfterUpdate()
' Find the record that matches the control.

On Error GoTo cboStreetNames_AfterUpdate_Err

If chkAllUT = True Then
DoCmd.ShowAllRecords
Me.cboStreetNames.Requery
DoCmd.ApplyFilter "qSearchStreet"
Me.cboStreetNames.Requery
Else
DoCmd.ShowAllRecords
Me.cboStreetNames.Requery
DoCmd.ApplyFilter "qSearchStreet", "JobID = " & Me.JobID
Me.cboStreetNames.Requery
End If

cboStreetNames = ""
chkAllUT = False
DoCmd.GoToControl "cboStreetNames"

cboStreetNames_AfterUpdate_Exit:
Exit Sub

cboStreetNames_AfterUpdate_Err:
MsgBox Error$
Resume cboStreetNames_AfterUpdate_Exit

End Sub

If chkAllUT = True then it should show everything, which it does, but
with
the wrong KeyID.

This is where I kinda suspect the problem to be:

Private Sub Form_Current()

If Not IsNull(Me.OpenArgs) Then
Me.JobID = Me.OpenArgs
End If
...
But when I remove this code it still does the same thing.

my combo box filters against several fields:

SELECT tblCuts.Address1, tblCuts.StreetName, tblCuts.From, tblCuts.To,
tblUtilities.UtilityAlias, tblCuts.JobID, *
FROM tblUtilities INNER JOIN tblCuts ON tblUtilities.KeyID =
tblCuts.JobID
WHERE ((([Forms].[fCuts].[cboStreetNames]) Is Null)) OR
(((tblCuts.Address1)
Like "*" & [Forms].[fCuts].[cboStreetNames] & "*")) OR
(((tblCuts.StreetName)
Like "*" & [Forms].[fCuts].[cboStreetNames] & "*")) OR (((tblCuts.From)
Like
"*" & [Forms].[fCuts].[cboStreetNames] & "*")) OR (((tblCuts.To) Like
"*"
&
[Forms].[fCuts].[cboStreetNames] & "*"))
ORDER BY tblCuts.DateCalled DESC;

Sorry, a lot to take in.
Please help
Thanks,
NickX





.



Relevant Pages

  • Re: coding a command button to change properties on another form
    ... Private Sub Form_Open ... If OpenArgs = "ICameFrom Travel Agency Note Form" Then ... Candia Computer Consulting ... On this command button that has a macro, ...
    (microsoft.public.access.formscoding)
  • Re: ID mixing with all records
    ... it in design view and checking the properties of the form to see if a filter ... Microsoft Office/Access MVP ... "Jeff Boyce" wrote: ... Private Sub Form_Current ...
    (microsoft.public.access.forms)
  • RE: KeyDown Escape Key not working
    ... buried in the original post. ... Here's the code that should probably be OpenArgs: ... Private Sub Form_Load ... ' AddProducts command button on Suppliers form. ...
    (microsoft.public.access.formscoding)
  • Re: Problem with filtering a combo box...
    ... Microsoft Office/Access MVP ... I am creating a form where I have three combo boxes, each with a toggle ... I have the entries okay in the combo box, ... Private Sub tglByDispatchMethod_Click ...
    (microsoft.public.access.formscoding)
  • Re: copy value of field to find a record in another form
    ... What I'm trying is to create a command button and used the build button - ... Private Sub Form_Open ... I looked up the help on OpenArgs - but wasn't really sure where it was to go ... > You can then place code in the Open event of the AddressBook form that takes ...
    (microsoft.public.access.forms)