A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multiple Date Parameters In Query



 
 
Thread Tools Display Modes
  #11  
Old February 1st, 2010, 04:39 PM posted to microsoft.public.access.forms
hobbit2612 via AccessMonster.com
external usenet poster
 
Posts: 107
Default 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  
Old February 1st, 2010, 04:57 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old February 1st, 2010, 05:37 PM posted to microsoft.public.access.forms
hobbit2612 via AccessMonster.com
external usenet poster
 
Posts: 107
Default 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  
Old February 1st, 2010, 06:37 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old February 1st, 2010, 07:49 PM posted to microsoft.public.access.forms
hobbit2612 via AccessMonster.com
external usenet poster
 
Posts: 107
Default 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  
Old February 1st, 2010, 10:05 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old February 2nd, 2010, 07:51 PM posted to microsoft.public.access.forms
hobbit2612 via AccessMonster.com
external usenet poster
 
Posts: 107
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.