subform, repeat entered values to next post

kursula

New member
Local time
Yesterday, 19:29
Joined
Jul 16, 2012
Messages
9
Hi i have a weird problem, i'm building a user interface in access and i want certain entered values in subforms to repeat/copy to the next record - it's working for one subform but not another (a subsubform) and i cannot find out why.
I'm doing it like this: in the 'properties' -> 'events' of the control in question i use following code:

Private Sub combo_ApparatEPID_AfterUpdate()
If Not IsNull(Me.combo_ApparatEPID.Value) Then
Me.combo_ApparatEPID.DefaultValue = Me.combo_ApparatEPID.Value
End If
End Sub

in the subform the correct values get copied when going to the next empty record, but in the case of the sub-subform the values become: #Name? when making a new record. it's really weird since i can write out the correct value using messagebox:

If Not IsNull(Me.combo_EPIDdelta4.Value) Then
Me.combo_EPIDdelta4.DefaultValue = Me.combo_EPIDdelta4.Value
MsgBox (Me.combo_EPIDdelta4.DefaultValue)
End If

Anyone has any idea as how to resolve this? I'm running Access 2000 since i'm working at a hospital which gives some constraints on software updating so to speak.
 
Ok, so i just found out myself, the expression :
IsNull(Me.combo_ApparatEPID.Value)

is not possible to evaluate (Value being a string i guess? )

I removed the if statement resolving the problem (actually didn't need it)
 
argh, i was too quick there, above solution didn't work
 
Try:
Me.combo_EPIDdelta4.DefaultValue = """" & Me.combo_EPIDdelta4.Value & """"
 
My god, that did work. I tried " & Me.combo_EPIDdelta4.Value & ", "" & Me.combo_EPIDdelta4.Value & "" and """ & Me.combo_EPIDdelta4.Value & """, before but NOT with *four* quotationmarks. Thank you so much! saved me from headache!
 

Users who are viewing this thread

Back
Top Bottom