Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop-Up Continous Form for Subform 2

Status
Not open for further replies.

cstuart79

Technical User
Nov 2, 2009
171
US
I want to have a pop-up continuous form "SESSIONS_SOURCES" that appears upon clicking a unique record in parent form "SOURCES" which is embedded as a subform on the main form "CLIENTS". I created the "SESSIONS_SOURCES" table and corresponding form; however, upon attempting to link it to the parent form "SOURCES" I got a message that said a subform added to a subform cannot be coninuous. Not sure how to accomplish this link as well as unsure of how to make it a pop-up.
 
The Val() function returns a number. If [Sender Comp ID] is text, you may need to set the default like:
Code:
  Me.Text14.defaultValue = """" & dd & """"
BTW: you aren't providing where Port, Session ID, or Sender Comp ID are coming from. Also, do everyone a favor and change Text14 to something like "txtSenderCompID".

Duane
Hook'D on Access
MS Access MVP
 
pop up works great, default values are being passed to new records properly--the only thing that is not quite right is that upon opening the main form i get the following error:

Invalid use of Null

any ideas for how to fix this? do i need to put nz on each
default value string for Private Sub Form_Load()?
 
Use Variant instead of String data type.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
tried changing to variant but still get the same "null" error. this is the code i am using to pass default values to new records:

Private Sub Form_Load()
Dim bb As Variant
bb = [Port]
Text16.DefaultValue = Val(bb)
Dim cc As Variant
cc = [Session ID]
Session_ID.DefaultValue = Val(cc)
Dim dd As Variant
dd = [Sender Comp ID]
Text14.DefaultValue = """" & dd & """"
End Sub
 
OK, use the Nz function:
Session_ID.DefaultValue = Val(Nz(cc), 0)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Attempting to provide where Port, Session ID, or Sender Comp ID are coming from. Receiving an error "Object required".

Control "Port" is on subform "SESSIONS". Trying to pass this to control "Port" on subform "SESSIONS SOURCES".

Control "Sender Comp ID" is on subform "SESSIONS". Trying to pass this to control "Sender Comp ID" on subform "SESSIONS SOURCES".

Control "Session ID" is on subform "SESSIONS". Trying to pass this to control "Session ID" on subform "SESSIONS SOURCES".

Private Sub Form_Load()
Dim bb As String
bb = SESSIONS.Port
[SESSIONS SOURCES].Port.DefaultValue = Val(bb)
Dim cc As String
cc = SESSIONS.[Session ID]
[SESSIONS SOURCES].Session_ID.DefaultValue = Val(cc)
Dim dd As String
dd = SESSIONS.[Sender Comp ID]
[SESSIONS SOURCES].[Sender Comp ID].DefaultValue = """" & dd & """"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top