RE: CBO Selection utilizing the same table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



99 times out of 100, using bound combo boxes for searching is a bad idea.

I would suggest using a sequential number to identify each "redo" of an
audit. Use the IDAudit and the New "AuditVersion" as a composite primary key.

Make your bound fields text boxes on the form. Make you combo unbound. It
should have two fields, the IDAudit and Audit Version. That way the user can
select the audit and the version from the combo.

To handle the sequencing, here is some code that determines the next number
to use:

Me.txtAuditVersion = Nz(DLookup("[AuditVersion]", "tbl_Audit",
"[IDAudit] = " & Me.txtIDAudit),0) + 1

To use the combo to look up an audit record, use the combo's After Update
event:

With Me.RecordsetClone
.FindFirst "[IDAudit] = " & Me.cboAudit.Column(0) & " And "
[AuditVersion] = " & Me.cboAudit.Column(1)
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

--
Dave Hargis, Microsoft Access MVP


"Damian S" wrote:

Hi jer99,

You need to have your combo bound to the Audit_Set field, and have the data
source for the combo update after you have selected the company the Audit is
for, eg: select * from tbl_Audit where companyID = me.lngCompanyID

or something similar.

Hope this helps.

Damian.

"jer99 via AccessMonster.com" wrote:

I have a table of audits.
An audit is related to many comments. The audit has an unique IDAudit, a name,
a date range and a client among other fields.
Since an audit can be redone and I wish to keep the details of each "re-do",
I just add a new record (IDAudit is autonumber) for the same date range and
client.
I wanted to record which audit record was the original for a specific client
and date range. So I had this brainstorm to add a field called "Audit_Set".
The Audit_Set would equal the ID_Audit of the original.

Cool.
Now I have my Audit entry form and I give a new audit a name. I would like to
have a CBO box that shows what the original audit was and if it is empty,
allow me to select one from a list of all audits for the particular client.
I've given myself a headache. I cant seem to figure out if I need to do
something in VBA after the update of the audit name, or if I need to do
something in the CBO. I'm assuming that the CBO should be left unbound.

Any help would be greatly appreciated!!!

--
Message posted via http://www.accessmonster.com


.



Relevant Pages

  • Re: Disabling "In-coming email" on a list
    ... Ok I have the audit info below. ... Object Operation: ... Primary Logon ID: ... Client User Name: WSSAdmin ...
    (microsoft.public.sharepoint.windowsservices)
  • Security Audit
    ... We have a client that requires the ability to audit any changes made to ... I created a couple of triggers on the WebGroupMembership table, ... FROM dbo.Webs w INNER JOIN ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: Logon events and log parsing
    ... We can audit client workstations log on and log off ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: WebServices Testing
    ... I'm sure his client wants a report that says that their ... and often make it not appear in their final version of the report. ... If they don't the audit may go off without ... Cenzic Hailstorm finds vulnerabilities fast. ...
    (Pen-Test)
  • Re: Print Auditing
    ... Event Type: Success Audit ... Client Domain: STAFFORD ... > configure auditing for objects, a printer is an object, like folders, ... >> administrator to turn on auditing using Group Policy Editor. ...
    (microsoft.public.windows.server.security)