T
Tim
Hi folks,
I need a help on my following code:
Private Sub Form_Current()
Dim dbCurrent As Database
Dim rst As Recordset
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("select field1 from
table1")
Me.Text0.Value = rst.Fields("field1").Value
End Sub
The code is working fine if the recordset is not null. If
the recordset is null, it will give me an error message.
I want me.text0.value=null when recordset is null.
Could anyone show me how to do it?
Thanks in advance.
Tim.
I need a help on my following code:
Private Sub Form_Current()
Dim dbCurrent As Database
Dim rst As Recordset
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("select field1 from
table1")
Me.Text0.Value = rst.Fields("field1").Value
End Sub
The code is working fine if the recordset is not null. If
the recordset is null, it will give me an error message.
I want me.text0.value=null when recordset is null.
Could anyone show me how to do it?
Thanks in advance.
Tim.