Jim Lawrence (AccessD)
accessd at shaw.ca
Tue Nov 16 12:48:47 CST 2004
Hi John: Scary...I guess they have not been audited yet. To my understanding only cash-sales do not officially require a invoice number but all sales must have an internal audit number. Even deleted or destroyed transactions must be saved or archived. Of course the USA IRS may not be as ruthless..? Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Colby, John Sent: Tuesday, November 16, 2004 8:33 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] What happens to the recordset? Actually I am accessing related data in another table entirely (child). I know about the recordsetclone. What I am doing is... DIS has people / companies invoice them where the invoice does not have an invoice number. If there is an invoice number, we put it in the memo field of the generated check (out in Quickbooks). If there is no invoice number provided, we create one with a DISXXX where XXX is just an incrementing number. The issue is that the idiots that don't provide an invoice number call us up complaining that they don't know what the check is for. So.... The invoice is for a set of related expenses (for a given claim). Since the expense is child to the Invoice (a line item of the Invoice), I want to go get the first expense (line item) and copy the description into a field up in the invoice. That description will now be printed on the check memo field so that they at least can go looking for the expense description (they provide us) and try to cut down on the calls from idiots. It is incredible to me that a company mails an invoice without an invoice number. HELLO!!! ANYONE HOME OUT THERE? And then they complain when they can't figure out what the payment is for. The stupids are ganging up on us! John W. Colby The DIS Database Guy -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Tuesday, November 16, 2004 10:56 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] What happens to the recordset? Hi John: There is a default recordset created when a form is opened and can be used in all sorts of ways. When a bound form is opened the recordset is pre-filled. You can access and use it like: Dim rs as Object Set rs = Me.Recordset.Clone rs.FindFirst "[ContractNumber] = '" & Me![cmbFindContractNumber] & "'" If Not rs.EOF Then Me.Bookmark = rs.Bookmark When the form is closed both of the recordsets are automatically closed as a clone can not exist without it's 'original'. Your code is just another way of accessing it. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Colby, John Sent: Tuesday, November 16, 2004 6:59 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] What happens to the recordset? I learned a long time ago that you could retrieve a value from a single record recordset using syntax like: strInvAlt = db.OpenRecordset(strSQL)!TopExpense where you don't dim a recordset, you just opened the recordset using db.openrecordset() and then referenced a field of the recordset with the !SomeField syntax. My question is, the recordset itself is never assigned to a dimmed recordset object. Furthermore there is no db.CloseRecordset() syntax. Does the recordset just stay open until the database object itself is closed or is used to open a different recordset? I have a situation where I would dim a database object in the form header and set that database object in OnOpen (to save the time it takes to Set DB), then use this syntax to retrieve a value in OnCurrent. I don't want the recordset hanging out there though. In thinking this through it seems that if the db is not dimmed / set each time in the OnCurrent then I should NOT use this syntax, but rather dim / set a recordset object as well in the form header / OnOpen and then set the recordset object in the OnCurrent, grab the field value and explicitly close the recordset (but NOT set the recordset object = nothing) Did that make any sense? Thoughts on the subject? John W. Colby The DIS Database Guy -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com