Modal Form (1 Viewer)

leean2

New member
Local time
Today, 13:21
Joined
Nov 17, 2011
Messages
1
Hello....need some help if this is possible...I have a form that has a Frame Yes/No (1/2) question...I have gotten a select code to work that says if Frame is 1 to open my modal form...the modal form will have additional information for the individual to complete based on the Yes answer...the problem I am having is....I have one table...so how do i get the information from my modal to populate in the table, on the record that is active?

Here is the code:
Private Sub Frame24_AfterUpdate()
Select Case Frame24
Case "1"
DoCmd.OpenForm "frm400Q1", acNormal
Case Else
End Select
End Sub
The modal form opens...it is after I input the data, it is not carrying over to the table...what I did was for the questions in the modal form I dropped into a seperate query and based the record source of the modal on the query....any ideas....i feel like pulling my hair out

AGreen
 

EssexRich

Registered User.
Local time
Today, 19:21
Joined
Nov 18, 2011
Messages
18
Set the record source on the modal form to be the same table as the main form. Then set the filteronopen property to yes, and filter the form to match the same ID as your main form.

ie something like:

filter=[mainform].[yourID]
filter on=true

hope this makes sense!

Rich
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 19:21
Joined
Jan 22, 2010
Messages
26,374
Set the record source on the modal form to be the same table as the main form. Then set the filteronopen property to yes, and filter the form to match the same ID as your main form.

ie something like:

filter=[mainform].[yourID]
filter on=true

hope this makes sense!

Rich
That is one way but this means the form will always be bound to the control. Using the WHERE argument of the OpenForm method gives you more flexibility.
 

EssexRich

Registered User.
Local time
Today, 19:21
Joined
Nov 18, 2011
Messages
18
fair enough, every day's a school day!

how does it give you more flexibility?

thx
 

vbaInet

AWF VIP
Local time
Today, 19:21
Joined
Jan 22, 2010
Messages
26,374
You can choose whether to filter it (by applying criteria) or not to filter (by leaving that argument blank).

Plus, it's just one line of code.

Both methods are equivalent though.
 

EssexRich

Registered User.
Local time
Today, 19:21
Joined
Nov 18, 2011
Messages
18
ah I'm with you. thanks for taking the time to explain.
 

Users who are viewing this thread

Top Bottom