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  

Funny Split Form Bug?



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2010, 06:33 AM posted to microsoft.public.access.forms
Kaoli
external usenet poster
 
Posts: 13
Default Funny Split Form Bug?

Hi all, I just found a funny thing in Ms Access 2007

I have a splitform, in the form Header I have a combobox to call a rowsource
from a table(period),which have Period,Start date, End Date

when I update/add the record at the form is OK! but when I update/add the
record in datasheet problem will occurs for 2nd column and 3rd column,
cboperiod.column(1)&(2)=null why ?

is it a bug? or my code got problem?
I tried this about few weeks only found different between form and datasheet
key in.

my code as per below;

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.YearMonth) Then
Me.YearMonth = Me.CboPeriod
Else
End If

Dim dCurrentDate As Date, dStart As Date, dEnd As Date, dtest As Date

'Set date as region date format or not ms access will treat as mm/dd/yyy
dCurrentDate = Format(Me.TranDate, "dd/mm/yyyy")
dStart = Format(Me.CboPeriod.Column(1), "dd/mm/yyyy")
dEnd = Format(Me.CboPeriod.Column(2), "dd/mm/yyyy")

If dCurrentDate dStart Or dCurrentDate dEnd Then
MsgBox "Invalid Date, Date must within selected period"
Cancel = True
End If
End Sub

Private Sub cboPeriod_AfterUpdate()
Dim dStart As Date, dEnd As Date, dtest As Date
Me.Requery
Me.Refresh
Me.CboPeriod.DefaultValue = Me.CboPeriod
End Sub

Private Sub Form_Load()
Me.Requery
Me.Refresh
End Sub
 




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 02:18 PM.


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