Home Access: trying to open a form and populate a textbox with the value from another form
Reply: 0

Access: trying to open a form and populate a textbox with the value from another form

user956
1#
user956 Published in April 21, 2018, 3:34 pm

Okay, I'm obviously doing something wrong, but can't figure out what it is, and this should be pretty simple.

I have a button on a form that opens another form and populates a textbox in the second form with a value from the first form.

Here is my code:

Private Sub test_Click()
DoCmd.OpenForm "subfrm_EA_COMMENT_ADD"
Forms!subfrm_EA_COMMENT_ADD.txtUWI = Me.txtUWI
End Sub

This works just fine, however I want the form to open in a dialog window, so I modified the script to this:

Private Sub test_Click()
DoCmd.OpenForm "subfrm_EA_COMMENT_ADD", acNormal, , , acFormAdd, acDialog
Forms!subfrm_EA_COMMENT_ADD.txtUWI = Me.txtUWI
End Sub

Now I am getting a run-time error 2450.

I've searched around regarding this error, but can't find any answers that work.

Can anyone point me in the right direction as to what I'm missing?

Thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307838 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO