Can anyone tell me what's wrong with this code? '
It worked fine before, but for some unknown reason is not counting records anymore. This is to see if is there any record departing on the same date that is the text box ETD_Txt, and if so, will open a second form Everything is stored in the table tMov.
I don't know if I changed anyproperty in any of the tables, or indexes, so I also someone can tell me why it stopped working, I would appreciate... I hope is not a bug on my pc.
.:banghead:
I tried several things, but noting makes it work.
Private Sub mov_Click()
If DCount("movid", "tmov", "etd =#" & Me.ETD_Txt.Value & "#") Then
DoCmd.OpenForm "fmov_1"
Else:
Me.Text16.Value = Me.ETD_Txt.Value & "_" & Left(Me.TypeTransport, 3) & DCount("movid", "tmov", "etd =#" & Me.ETD_Txt.Value & "#") + 1 & "_" & Me.movFromCounty.Value & "-" & Me.movToCounty.Value & "_" & Left(Me.typetransport_txtbox.Value, 2)
End If
end sub
Thanks
It worked fine before, but for some unknown reason is not counting records anymore. This is to see if is there any record departing on the same date that is the text box ETD_Txt, and if so, will open a second form Everything is stored in the table tMov.
I don't know if I changed anyproperty in any of the tables, or indexes, so I also someone can tell me why it stopped working, I would appreciate... I hope is not a bug on my pc.
.:banghead:
I tried several things, but noting makes it work.
Private Sub mov_Click()
If DCount("movid", "tmov", "etd =#" & Me.ETD_Txt.Value & "#") Then
DoCmd.OpenForm "fmov_1"
Else:
Me.Text16.Value = Me.ETD_Txt.Value & "_" & Left(Me.TypeTransport, 3) & DCount("movid", "tmov", "etd =#" & Me.ETD_Txt.Value & "#") + 1 & "_" & Me.movFromCounty.Value & "-" & Me.movToCounty.Value & "_" & Left(Me.typetransport_txtbox.Value, 2)
End If
end sub
Thanks