cosmicslop
New member
- Local time
- Today, 21:23
- Joined
- May 22, 2002
- Messages
- 9
Hi, I'm very new at this and I am struggling to make some kind of code in order to fill up a field automaticaly when it corresponds with some criteria.
In a continuous form, On exit of field3 I want to check if the rtrim of field2 from the current record corresponds with the rtrim of field 2 of the next record, if so the value of field3 from the current record should be filled in field3 of the next record
I tried something but I crashed and burned with it
any ideas?
Private Sub field3_Exit(Cancel As Integer)
if dlookup rtrim("[field2]"),"tabel","[field1]"=forms![frm_1])= dlookup rtrim("[field2]"),"tabel","[field1]"=forms![frm_1]![field1]+1)then dlookup ("[field3]"),"tabel","[field1]"=forms![frm_1]![field1]+1)= dlookup("[field3]"),tabel","[field1]"=forms[frm_1])
End If
In a continuous form, On exit of field3 I want to check if the rtrim of field2 from the current record corresponds with the rtrim of field 2 of the next record, if so the value of field3 from the current record should be filled in field3 of the next record
I tried something but I crashed and burned with it
any ideas?
Private Sub field3_Exit(Cancel As Integer)
if dlookup rtrim("[field2]"),"tabel","[field1]"=forms![frm_1])= dlookup rtrim("[field2]"),"tabel","[field1]"=forms![frm_1]![field1]+1)then dlookup ("[field3]"),"tabel","[field1]"=forms![frm_1]![field1]+1)= dlookup("[field3]"),tabel","[field1]"=forms[frm_1])
End If