vba - Access 2010 New Record with Phantom Data -
access 2010 here.
i have nagging concern 2 of 3 subforms. subforms each bound own table unique information; main form bound own table. 3 subform tables in one-to-one relationship main form table. first subform acts in when there new record, of bound entry fields displayed blank. code in form_current():
private sub form_current() 'determine should displayed' 'do stuff prepare current record display' if me.newrecord = true me.stuff = null end if end sub
is nowadays 3 subforms , main form display older records , ready form info entry resetting check boxes etc; there no code "reset" entry fields themselves. unfortunately, other 2 subforms retain info lastly entered record , display if user wants re-enter same data. thing is, info means nil unless user explicity enters info entry field , leaves means. moving on next record without entering info entry fields doesn't save phantom pre-entered info (which expected record in subform never made user never entered info in subform).
what looking either form-specific alternative open clean record default, or vba code can ensure empty info fields on new record. have tried actively re-quering subforms when new record opened in main form without success. have tried pre-setting vaules "" upon entering new record, did work extent, seeing 1 subform works properly, after solution, not workaround.
thank input!
go design view on subform, , in subform's properties find setting called "data entry".
changing "yes" alter subform's behavior.
from on subform clear , ready take info new records. after record entered, subform cleared , ready brand new record.
this alternative available form.
i update other 2 subforms setting. easy, , no vba necessary!
vba table ms-access record subform
No comments:
Post a Comment