Populating a continuous form

ECEK

Registered User.
Local time
Today, 19:41
Joined
Dec 19, 2012
Messages
717
I have a continuous form that opens based on a table with an open to specific records reference. If there is one record with the reference then only one record shows, if there are two records then two records will show etc.

There are four fields on my form:
Client (already populated) and three additional fields that I wish to populate from unbound fields on the form

So I have three unbound fields and when i press confirm I want ALL of the fields for ALL of the records to be populated.

This is my code:
Code:
Private Sub Command17_Click()

If IsNull(Combo9) Or IsNull(Text12) Then
MsgBox "You need to populate the Type of Appointment and the date"
Exit Sub
End If

Me.tor = Me.Combo9
Me.app_date = Me.Text12
Me.app_time = Me.Text15

End Sub

My problem is that it only populates the first record.

Is there a way of it populating all of the visible records?
 
You will need to bind the fields to a table. It would probably be easiest just to add field to the table that contains the client.

If tell us more about what you are trying to accomplish we might be able to suggest alternatives.
 
Simplest is to run an update query on the underlying table, using the specific record in the criteria, then requery the form.
 
I have a list of clients
Each client may or may not have a partner.

If they do they share a reference.

I want to type an appointment date and for it to populate the appointment date in both clients appointment field.

Same for the time of appointment and the type of appointment.
 
Im guessing that this would be better achieved by utilising Query Update?
 
Yes as Dave/Bob/Paul suggested. As you have a variable number of records returned you would have to loop through the underlying recordset in VBA, it's much more efficient to run an update query on the records you want.
 
Last edited:
Bob?!? May you develop a shank or come down with a case of the yips! :p
 

Users who are viewing this thread

Back
Top Bottom