If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Multiple Date Parameters In Query
John,
Please ignore the last message I posetd. It was meant for the another John that had helped me out with some other issues I had. Apologies for messing you around. Kind regards Chris hobbit2612 wrote: John, You very kindly gave me all the assistance with the problem I had on tracking changes to my database fields which, worked a treat. But I've now noticed that the checkboxes on the record now show that they have been changed when they haven't. I've narrowed this down to it happening when the record is created. So e.g. when I add an Invoice Number for example the checkbox also shows it has been updated. I've tried a few things to sort this, changing the default value to 0, then changing the checkbox physically on screen to a text box but this caused further problems, but I just can't fathom it out. Could you tell me please is there anyway to get around this. Many thanks Chris Cheers take care! [quoted text clipped - 4 lines] Very glad to have been of assistance! -- Message posted via http://www.accessmonster.com |
#12
|
|||
|
|||
Multiple Date Parameters In Query
On Mon, 01 Feb 2010 16:34:46 GMT, "hobbit2612 via AccessMonster.com"
u27332@uwe wrote: You very kindly gave me all the assistance with the problem I had on tracking changes to my database fields which, worked a treat. But I've now noticed that the checkboxes on the record now show that they have been changed when they haven't. I've narrowed this down to it happening when the record is created. So e.g. when I add an Invoice Number for example the checkbox also shows it has been updated. I've tried a few things to sort this, changing the default value to 0, then changing the checkbox physically on screen to a text box but this caused further problems, but I just can't fathom it out. Could you tell me please is there anyway to get around this. Not without some more information! What's the Recordsource of the form? Post the SQL. Which fields are getting set inappropriately? What - if any - code or macros do you have in the Form's Current, BeforeInsert, or BeforeUpdate event? What about the Invoice Number control's AfterUpdate event? -- John W. Vinson [MVP] |
#13
|
|||
|
|||
Multiple Date Parameters In Query
John, it's very good of you to offer some help, so many thanks
The subform where the problem occurs is linked directly to the table so there is no SQL to post. The fields that are getting set inapproriately are InvoicePaid and ReportIssued. There is no code in the OnCurrent event but there is the following in the 'BeforeUpdate event. I've cut this down because there are quite a lot of fields some of which are commercially sensitive, but they all mirror the coding with the difference being the field names. Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.InvoiceNumber & "" Me.InvoiceNumber.OldValue & "" Then Me.InvoiceNumberChanged = Date End If If Me.InvoicePaid & "" Me.InvoicePaid.OldValue & "" Then Me.InvoicePaidChanged = Date End If If Me.ReportIssued & "" Me.ReportIssued.OldValue & "" Then Me.ReportIssuedChanged = Date End If End Sub In the AfterUpdate event of the InvoiceNumber there is a saverecord piece of coding but even when I've disabled this the problem still occurs. I hope this helps, and once again many thanks for the help. Regards Chris John W. Vinson wrote: You very kindly gave me all the assistance with the problem I had on tracking changes to my database fields which, worked a treat. But I've now noticed [quoted text clipped - 10 lines] Could you tell me please is there anyway to get around this. Not without some more information! What's the Recordsource of the form? Post the SQL. Which fields are getting set inappropriately? What - if any - code or macros do you havein the Form's Current, BeforeInsert, or BeforeUpdate event? What about the Invoice Number control's AfterUpdate event? -- Message posted via http://www.accessmonster.com |
#14
|
|||
|
|||
Multiple Date Parameters In Query
On Mon, 01 Feb 2010 17:37:58 GMT, "hobbit2612 via AccessMonster.com"
u27332@uwe wrote: There is no code in the OnCurrent event but there is the following in the 'BeforeUpdate event. I've cut this down because there are quite a lot of fields some of which are commercially sensitive, but they all mirror the coding with the difference being the field names. Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.InvoiceNumber & "" Me.InvoiceNumber.OldValue & "" Then Me.InvoiceNumberChanged = Date End If If Me.InvoicePaid & "" Me.InvoicePaid.OldValue & "" Then Me.InvoicePaidChanged = Date End If If Me.ReportIssued & "" Me.ReportIssued.OldValue & "" Then Me.ReportIssuedChanged = Date End If End Sub In the AfterUpdate event of the InvoiceNumber there is a saverecord piece of coding but even when I've disabled this the problem still occurs. I hope this helps, and once again many thanks for the help. On a new record, the OldValue will be NULL. If you don't want the record datestamped when it's entered, check the form's NewRecord property: If Not Me.NewRecord Then your if statements End If -- John W. Vinson [MVP] |
#15
|
|||
|
|||
Multiple Date Parameters In Query
Hi John, thanks very much for replying.
I've been playing around with this and it doesn't seem to like the 'End If' for this statement because of my other If Statements. It comes up with the error 'Compile error: Block If without End If'. Any ideas please Regards Chris John W. Vinson wrote: There is no code in the OnCurrent event but there is the following in the 'BeforeUpdate event. I've cut this down because there are quite a lot of [quoted text clipped - 17 lines] I hope this helps, and once again many thanks for the help. On a new record, the OldValue will be NULL. If you don't want the record datestamped when it's entered, check the form's NewRecord property: If Not Me.NewRecord Then your if statements End If -- Message posted via http://www.accessmonster.com |
#16
|
|||
|
|||
Multiple Date Parameters In Query
On Mon, 01 Feb 2010 19:49:06 GMT, "hobbit2612 via AccessMonster.com"
u27332@uwe wrote: Hi John, thanks very much for replying. I've been playing around with this and it doesn't seem to like the 'End If' for this statement because of my other If Statements. It comes up with the error 'Compile error: Block If without End If'. Any ideas please Well... since you didn't (couldn't) post the actual code, all I can say is that I'd be inclined to carefully pair up If and End If lines in your code. If the compiler says there's a Block If without End If, I'd expect that it's correct and that you have one more If line than you have End If. -- John W. Vinson [MVP] |
#17
|
|||
|
|||
Multiple Date Parameters In Query
John,
Many thanks for the advice and for your time and trouble. Regards Chris John W. Vinson wrote: Hi John, thanks very much for replying. [quoted text clipped - 3 lines] Any ideas please Well... since you didn't (couldn't) post the actual code, all I can say is that I'd be inclined to carefully pair up If and End If lines in your code. If the compiler says there's a Block If without End If, I'd expect that it's correct and that you have one more If line than you have End If. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201002/1 |
|
Thread Tools | |
Display Modes | |
|
|