I have a formREGION and a SubFormTown
I have 2 tables tables
TblREGION avec 2 champs
- RegCode(2)
- NomReg(20)
TblTown avec 3 Champs
- TownCode(4)
- TownName
- CodeReg(2)
The TownCode must be built with CodeReg + 2 Char previously typed by the user in the field TownCode.
As the user type the info in SubFormTown, I would like to automaticly assign the 2 Char of RegCode to the field TownCode. The 2 others Char that would be typed shoud be concatenated to the others. And, update the record.
This is what I tried:
I have a formREGION and a SubFormTown, I have 2 tables
TblREGION with 2 fieldss
- RegCode(2) - NomReg(20)
TblTown with 3 fields
- TownCode(4) - TownName - CodeReg(2)
The TownCode must be built with CodeReg + 2 Char previously typed by the user in the field TownCode.As the user type the info in SubFormTown, I would like to automaticly assign the 2 Char of RegCode to the field TownCode. The 2 others Char that would be typed shoud be added. I tried this:
Private Sub CodeVille_BeforeUpdate(Cancel As Integer)
Dim CodeV as Variant
CodeV = Inputbox("Entrez le code ville")
Me![CodeVille]= Me![CodeReg] & CodeV
End Sub
The procedure does not run. Please Help
I have 2 tables tables
TblREGION avec 2 champs
- RegCode(2)
- NomReg(20)
TblTown avec 3 Champs
- TownCode(4)
- TownName
- CodeReg(2)
The TownCode must be built with CodeReg + 2 Char previously typed by the user in the field TownCode.
As the user type the info in SubFormTown, I would like to automaticly assign the 2 Char of RegCode to the field TownCode. The 2 others Char that would be typed shoud be concatenated to the others. And, update the record.
This is what I tried:
I have a formREGION and a SubFormTown, I have 2 tables
TblREGION with 2 fieldss
- RegCode(2) - NomReg(20)
TblTown with 3 fields
- TownCode(4) - TownName - CodeReg(2)
The TownCode must be built with CodeReg + 2 Char previously typed by the user in the field TownCode.As the user type the info in SubFormTown, I would like to automaticly assign the 2 Char of RegCode to the field TownCode. The 2 others Char that would be typed shoud be added. I tried this:
Private Sub CodeVille_BeforeUpdate(Cancel As Integer)
Dim CodeV as Variant
CodeV = Inputbox("Entrez le code ville")
Me![CodeVille]= Me![CodeReg] & CodeV
End Sub
The procedure does not run. Please Help