isOpen Syntax

  • Thread starter Thread starter Confused
  • Start date Start date
C

Confused

I'm getting "Sub or Function not defined " Could someon kindly give me the
correct syntax for this?

Private Sub Form_Open(Cancel As Integer)

If isopen("CLECSystemsInventory") Then
[CLEC ID].DefaultValue = [Forms]![CLECSystemsInventory]![CLEC ID]
End If
End Sub
 
Confused,

It looks to me like you need this...
If CurrentProject.AllForms("CLECSystemsInventory").IsLoaded Then
 
That stopped the error, and now it opens the form, but I can't get it to go
to the record = [CLEC ID]. Both fields are viewable on the form. Any
idea? Thanks!

Steve Schapel said:
Confused,

It looks to me like you need this...
If CurrentProject.AllForms("CLECSystemsInventory").IsLoaded Then

--
Steve Schapel, Microsoft Access MVP


Confused said:
I'm getting "Sub or Function not defined " Could someon kindly give me
the
correct syntax for this?

Private Sub Form_Open(Cancel As Integer)

If isopen("CLECSystemsInventory") Then
[CLEC ID].DefaultValue = [Forms]![CLECSystemsInventory]![CLEC ID]
End If
End Sub
 
Confused,

It is not clear what you are trying to achieve.

Your code manages the DefaultValue of the CLEC ID field on the form you are
opening. This property only has any effect at the point when a new record
will be created on the form. What is your intention?
 
I am trying to open the form "frmCLECS2wSystem" and make it go to the same
record as the record on the form I just came from Clec Systems Inventory.

The subform called "LENSTasks" is where I want to place the new record after
I click a check box called [completed] but need the main form to open to the
correct record. Now it opens the form but just goes to the first record.
Hope that makes sense. Thank you again.

Here is the if statement to open the form.

Private Sub Completed_AfterUpdate()
On Error GoTo Err_Command0_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCLECS2wSystem"
If Me.Completed = "-1" Then

DoCmd.OpenForm stDocName, , , stLinkCriteria
MsgBox "Add LEX to System List if not already added"

End If

Steve Schapel said:
Confused,

It is not clear what you are trying to achieve.

Your code manages the DefaultValue of the CLEC ID field on the form you are
opening. This property only has any effect at the point when a new record
will be created on the form. What is your intention?

--
Steve Schapel, Microsoft Access MVP


Confused said:
That stopped the error, and now it opens the form, but I can't get it to
go
to the record = [CLEC ID]. Both fields are viewable on the form. Any
idea? Thanks!
 
Confused,

If [Completed] is a checkbox, it will never have the value of "-1" anyway,
it will just be -1 without the ""s.

If I understands you correctly, and if the field that idetifies the record
you are going to is the CLEC ID, then I expect this is what you need...

Private Sub Completed_AfterUpdate()
If Me.Completed = -1 Then
DoCmd.OpenForm "frmCLECS2wSystem", , , "[CLEC ID] = " & Me.CLEC_ID
MsgBox "Add LEX to System List if not already added"
End If
End Sub

--
Steve Schapel, Microsoft Access MVP


Confused said:
I am trying to open the form "frmCLECS2wSystem" and make it go to the same
record as the record on the form I just came from Clec Systems Inventory.

The subform called "LENSTasks" is where I want to place the new record
after
I click a check box called [completed] but need the main form to open to
the
correct record. Now it opens the form but just goes to the first record.
Hope that makes sense. Thank you again.

Here is the if statement to open the form.

Private Sub Completed_AfterUpdate()
On Error GoTo Err_Command0_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCLECS2wSystem"
If Me.Completed = "-1" Then

DoCmd.OpenForm stDocName, , , stLinkCriteria
MsgBox "Add LEX to System List if not already added"

End If

Steve Schapel said:
Confused,

It is not clear what you are trying to achieve.

Your code manages the DefaultValue of the CLEC ID field on the form you
are
opening. This property only has any effect at the point when a new
record
will be created on the form. What is your intention?

--
Steve Schapel, Microsoft Access MVP


Confused said:
That stopped the error, and now it opens the form, but I can't get it
to
go
to the record = [CLEC ID]. Both fields are viewable on the form.
Any
idea? Thanks!
 
That did the trick. Thank you very much!

Steve Schapel said:
Confused,

If [Completed] is a checkbox, it will never have the value of "-1" anyway,
it will just be -1 without the ""s.

If I understands you correctly, and if the field that idetifies the record
you are going to is the CLEC ID, then I expect this is what you need...

Private Sub Completed_AfterUpdate()
If Me.Completed = -1 Then
DoCmd.OpenForm "frmCLECS2wSystem", , , "[CLEC ID] = " & Me.CLEC_ID
MsgBox "Add LEX to System List if not already added"
End If
End Sub

--
Steve Schapel, Microsoft Access MVP


Confused said:
I am trying to open the form "frmCLECS2wSystem" and make it go to the same
record as the record on the form I just came from Clec Systems Inventory.

The subform called "LENSTasks" is where I want to place the new record
after
I click a check box called [completed] but need the main form to open to
the
correct record. Now it opens the form but just goes to the first record.
Hope that makes sense. Thank you again.

Here is the if statement to open the form.

Private Sub Completed_AfterUpdate()
On Error GoTo Err_Command0_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCLECS2wSystem"
If Me.Completed = "-1" Then

DoCmd.OpenForm stDocName, , , stLinkCriteria
MsgBox "Add LEX to System List if not already added"

End If

Steve Schapel said:
Confused,

It is not clear what you are trying to achieve.

Your code manages the DefaultValue of the CLEC ID field on the form you
are
opening. This property only has any effect at the point when a new
record
will be created on the form. What is your intention?

--
Steve Schapel, Microsoft Access MVP


That stopped the error, and now it opens the form, but I can't get it
to
go
to the record = [CLEC ID]. Both fields are viewable on the form.
Any
idea? Thanks!
 
Confused said:
I'm getting "Sub or Function not defined " Could someon kindly give me
the
correct syntax for this?

Private Sub Form_Open(Cancel As Integer)

If isopen("CLECSystemsInventory") Then
[CLEC ID].DefaultValue = [Forms]![CLECSystemsInventory]![CLEC ID]
End If
End Sub
 
Back
Top