Set all fields to Nothing - is this possible

New2VB

Registered User.
Local time
Today, 05:50
Joined
Jun 9, 2010
Messages
131
Greetings Gurus, long time no see...

I was wondering if the following was even possible because after much googling I can't seem to find an answer.

Basically I have a sub-form (lets call it frm2) which looks up and displays fields based on the "ID" field in another subform (called frmIn).

What I would like to do is find a way so that the various textboxes in frm2 turn blank once the last record in the frmIn has been actioned (ie there are no records in the main form).

I tried
Code:
If (IsNull([Forms]![entry]![frmIn]![ID])) Then
'Me.RecordSource = ""
but that sets most fields as #Name and resets frm2s recordsource.

What I am looking to do is something like
Code:
Dim AllRecords as ???
If (IsNull([Forms]![entry]![frmIn]![ID])) Then AllRecords = Nothing/Null

Suggestions welcome.

Thank you.
 
Try and set the recordsource to a "false" record

ex:

Me.Recordsource = "Select * From Table/Query Where 1=0"

Change marked in red with your original recordsource

JR
 
Thanks for the quick reply JANR,

Clean, simple, efficient...I like it.
 

Users who are viewing this thread

Back
Top Bottom