Why this code does not work?

G

Guest

Why this code does not work?
[Report] is a checkbox located in a Subform named:lbl_ScrapDB_subform
and [shift_combo] is a combobox located in Form named:WScrapForm

could you please help

===============================================
Private Sub Report_Click()
If IsNull(Form!WScrapForm![shift_combo]) Then


MsgBox "You must Select the Shift where you work before report !",
vbCritical, "Warning, Shift not selected"
Report.Value = False
Else
Report.Value = Value


End If

End sub

==================================================
 
G

Guest

What are you trying to do? Report.Value? what is that?
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
G

Guest

Sorry

report.value = true

but the problem is getting information from the form


--
Lorenzo Díaz
Cad Technician


boblarson said:
What are you trying to do? Report.Value? what is that?
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.


ldiaz said:
Why this code does not work?
[Report] is a checkbox located in a Subform named:lbl_ScrapDB_subform
and [shift_combo] is a combobox located in Form named:WScrapForm

could you please help

===============================================
Private Sub Report_Click()
If IsNull(Form!WScrapForm![shift_combo]) Then


MsgBox "You must Select the Shift where you work before report !",
vbCritical, "Warning, Shift not selected"
Report.Value = False
Else
Report.Value = Value


End If

End sub

==================================================
 
G

Guest

I think you misunderstood my question. What are you trying to do. Are you
trying to open a report, or what? It would look like you have a command
button or something named REPORT, which is an Access reserved word and can
only cause you headaches by using it. Report.Value = True is another one
that would appear that you are using an Access reserved word and is going to
cause trouble.

So, instead of putting a sub down and then asking why this code isn't
working, how about telling us what you want it to do so we have a point of
reference.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.


ldiaz said:
Sorry

report.value = true

but the problem is getting information from the form


--
Lorenzo Díaz
Cad Technician


boblarson said:
What are you trying to do? Report.Value? what is that?
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.


ldiaz said:
Why this code does not work?
[Report] is a checkbox located in a Subform named:lbl_ScrapDB_subform
and [shift_combo] is a combobox located in Form named:WScrapForm

could you please help

===============================================
Private Sub Report_Click()
If IsNull(Form!WScrapForm![shift_combo]) Then


MsgBox "You must Select the Shift where you work before report !",
vbCritical, "Warning, Shift not selected"
Report.Value = False
Else
Report.Value = Value


End If

End sub

==================================================
 
D

Douglas J. Steele

Try

Forms!WScrapForm![shift_combo]

(i.e.: Forms with an s, as opposed to Form)
 
G

Guest

Hi Douglas, this works fine,

Now i have my DB running,

Here is the statement

Thanks a lot for your help, I have already clicked YES in "Did this post
answer the question?"
==================================================
If IsNull(Forms!WScrapForm![shift_combo]) Then

MsgBox "You must Select the Shift where you work before report !",
vbCritical, "Warning, Shift not selected"
Report_Q.Value = False
Else

'if Shift is seleceted then make this operation
Report_Q.Value = True
[Shift] = Forms!WScrapForm![shift_combo].Column(0)
[User_Name] = FOSUserName()
[Report_Date] = Now()


End If
End Sub
====================================================


--
Lorenzo Díaz
Cad Technician


Douglas J. Steele said:
Try

Forms!WScrapForm![shift_combo]

(i.e.: Forms with an s, as opposed to Form)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


ldiaz said:
Why this code does not work?
[Report] is a checkbox located in a Subform named:lbl_ScrapDB_subform
and [shift_combo] is a combobox located in Form named:WScrapForm

could you please help

===============================================
Private Sub Report_Click()
If IsNull(Form!WScrapForm![shift_combo]) Then


MsgBox "You must Select the Shift where you work before report !",
vbCritical, "Warning, Shift not selected"
Report.Value = False
Else
Report.Value = Value


End If

End sub

==================================================
 

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

Similar Threads


Top