Abdalla Ismail
Abdalla Ismail

Reputation: 409

Form field value from another form

I have an MS Access form called service that should contain a button (Open) that opens form payment.

The payment form contains a service id field which should be set automatically from the record form service where I pressed open.

How can I make it in Access?

Upvotes: 0

Views: 4475

Answers (1)

Gustav
Gustav

Reputation: 55806

That could be:

Dim FormName As String
Dim ServiceId As Long

FormName = "Payment"
ServiceId = Me!ServiceId.Value  ' get value of ServiceId to pass from current form.
DoCmd.OpenForm FormName
Forms(FormName)!ServiceId.Value = ServiceId

Upvotes: 2

Related Questions