Value in Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]
 
I'm not getting anything. Even w/the correct syntax.

Klatuu said:
What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

Anna said:
Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

Anna said:
I'm not getting anything. Even w/the correct syntax.

Klatuu said:
What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

Anna said:
Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




Klatuu said:
We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

Anna said:
I'm not getting anything. Even w/the correct syntax.

Klatuu said:
What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
You are going through a lot you don't really need to do. A DLookup will
return what you are looking for in one statment.

If IsNull(DLookup("[LSTReleaseDate]", "[TrackNo VALIDATE tbl]",
"[TrackNoValid] = " & Me.[frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid])) Then
MsgBox "This job has not been released by List Maintenance. Please make
sure the job is released before processing.", , "Cannot Process Job"
End If

Now for this or your original code to work, check:
[LSTReleaseDate] is a field in the table [TrackNo VALIDATE tbl]
[TrackNoValid] is Numeric field in [TrackNo VALIDATE tbl]
ListRelease Track tbl sbfrm is the name of the subform control on the form
frmListReleaseTrack
TrackNoValid is a control on the subform frmListReleaseTrack

Anna said:
Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




Klatuu said:
We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

Anna said:
I'm not getting anything. Even w/the correct syntax.

:

What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
I'm checking all that info now, I also wanted to add, that I am entering the
data into TrackNoValid

Anna said:
Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




Klatuu said:
We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

Anna said:
I'm not getting anything. Even w/the correct syntax.

:

What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
Okay, but because you are not using good naming conventions, TrackNoValid can
refer to two different objects. One is the field in the table and the other
is a control on your form. I assume you are entering the value in the form
and trying to look up a record with that value in the field in the table.

Anna said:
I'm checking all that info now, I also wanted to add, that I am entering the
data into TrackNoValid

Anna said:
Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




Klatuu said:
We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

:

I'm not getting anything. Even w/the correct syntax.

:

What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
Exactly. The interesting part is I copied that from another area of this
database and just modified it to try and work in this form and it's not
working.

Klatuu said:
Okay, but because you are not using good naming conventions, TrackNoValid can
refer to two different objects. One is the field in the table and the other
is a control on your form. I assume you are entering the value in the form
and trying to look up a record with that value in the field in the table.

Anna said:
I'm checking all that info now, I also wanted to add, that I am entering the
data into TrackNoValid

Anna said:
Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




:

We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

:

I'm not getting anything. Even w/the correct syntax.

:

What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 
I've tried everything, I still have no idea why this code isn't working!
'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"

Anna said:
Exactly. The interesting part is I copied that from another area of this
database and just modified it to try and work in this form and it's not
working.

Klatuu said:
Okay, but because you are not using good naming conventions, TrackNoValid can
refer to two different objects. One is the field in the table and the other
is a control on your form. I assume you are entering the value in the form
and trying to look up a record with that value in the field in the table.

Anna said:
I'm checking all that info now, I also wanted to add, that I am entering the
data into TrackNoValid

:

Ok Here ya go:


'This will check to see if the job has been released by List Maint. to
production, if not then then job cannot be processed
strLMReleased = "SELECT [TrackNo VALIDATE tbl].TrackNoValid, [TrackNo
VALIDATE tbl].LSTReleaseDate " & _
"FROM [TrackNo VALIDATE tbl] " & _
"WHERE [TrackNo VALIDATE tbl].TrackNoValid = " &
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].Form![TrackNoValid] & ";"
' [Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm]![TrackNoValid] & ";"
Set rstTables = dbsList.OpenRecordset(strLMReleased)
If Not rstTables.EOF Then
With rstTables
.MoveLast
.MoveFirst

If IsNull(rstTables!LSTReleaseDate) Then
MsgBox "This job has not been released by List Maintenance. Please
make sure the job is released before processing.", , "Cannot Process Job"
rstTables.Close
Exit Sub
End If

End With

End If
rstTables.Close



I hope this will help.




:

We need more information. Post the code that isn't working and a description
of what you are trying to do, please.

:

I'm not getting anything. Even w/the correct syntax.

:

What are you getting?
Just to make sure you are on the right track,
[ListRelease Track tbl sbfrm] should be the name of the subform control on
your main form, not the name of the form being used as a sub form. And, the
correct syntax should be:
[Forms]![frmListReleaseTrack]![ListRelease Track tbl
sbfrm].form![TrackNoValid]

:

Hi,
I have this code and for some reason I can't get the value of the field.
What am I doing wrong?

[Forms]![frmListReleaseTrack]![ListRelease Track tbl sbfrm]![TrackNoValid]

Thanks in advance!

Anna
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top