GK in the UK
Registered User.
- Local time
- Today, 13:03
- Joined
- Dec 20, 2017
- Messages
- 281
Hello all
Novice Access user here. Quick intro posted in Introductions but I'm basically an old Pascal hand of only moderate experience.
I seem to recall that in Pascal, it was Good Practice to initialise any variable on definition so I'm having to make a bit of adjustment with having all these nulls floating around. Undefined variables were guaranteed to (and did) introduce all sorts of garbage into your Pascal application.
I just got to a bit in my vba code where I'm about to set a field (column?) to 1 on first use. Then I thought, why aren't I setting the default in the Access table definition. I did set some numeric variables as defaults but I also read (I think) that string fields should never be initialised in the table. Allen Browne's site, maybe. I'm favouring setting numerics on first use in VBA code as it takes away the uncertainty (Did I set a default for this ?)
What's the accepted good practice on this ?
Novice Access user here. Quick intro posted in Introductions but I'm basically an old Pascal hand of only moderate experience.
I seem to recall that in Pascal, it was Good Practice to initialise any variable on definition so I'm having to make a bit of adjustment with having all these nulls floating around. Undefined variables were guaranteed to (and did) introduce all sorts of garbage into your Pascal application.
I just got to a bit in my vba code where I'm about to set a field (column?) to 1 on first use. Then I thought, why aren't I setting the default in the Access table definition. I did set some numeric variables as defaults but I also read (I think) that string fields should never be initialised in the table. Allen Browne's site, maybe. I'm favouring setting numerics on first use in VBA code as it takes away the uncertainty (Did I set a default for this ?)
What's the accepted good practice on this ?