Option Group Produce Script in Text Box

R

Rod

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
V

Vimal Ori

Syntax should be tblscripts.msg; dropping the square barces should do the
trick.
 
R

Rod

Error msg states sytax error "object required".

Vimal Ori said:
Syntax should be tblscripts.msg; dropping the square barces should do the
trick.


Rod said:
I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]
 
R

Rod

Runtime error. Object required. It now looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Me.Text131 = [tblScript]![MSG]
Case Is = 2
Me.Text131 = [tblScript]![MSG]
Case Is = 3
Me.Text131 = [tblScript]![MSG]
Case Is = 4
Me.Text131 = [tblScript]![MSG]
End Select

End Sub

It brings back the very first script then errors no matter which button is
selected.
The option group and text box are on the same form.

Klatuu said:
If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

Rod said:
I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

Do you have tblScript open as a recordset?
Does it have a field named Msg?

Klatuu said:
If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

Rod said:
I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

Klatuu said:
Do you have tblScript open as a recordset?
Does it have a field named Msg?

Klatuu said:
If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

Rod said:
I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

Rod said:
I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

Klatuu said:
Do you have tblScript open as a recordset?
Does it have a field named Msg?

Klatuu said:
If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

Klatuu said:
I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

Rod said:
I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

Klatuu said:
Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

Rod said:
Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

Klatuu said:
I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

Rod said:
I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

Klatuu said:
Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

Rod said:
Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

Klatuu said:
I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

Rod said:
tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

Klatuu said:
Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

Rod said:
Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

Klatuu said:
A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

Rod said:
tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

Klatuu said:
Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

Rod said:
I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

Klatuu said:
A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

Rod said:
tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

5 records in tblScripts
1) txtDialNumber control source is DIAL NUMBER. It is getting this number
by concatenating 1+AREA_CODE+INPUT_NUMBER(from a different form). - working
fine.
2) DNC is determine by an update query which looks at a list of numbers and
marks the DNC field as True in tblResume if the AREA_CODE+INMPUT_NUMBER are
found in the DNC list. - working fine.
3) CANDIDATE gets its value from tblResume Candidate name - working fine.
4) CALLED_ON gets its value from tblResume Called_On. This form can update
that value - working fine. Same thing for Call_Return and CO.
5) CAL RESULTS: when I created this combo box I put the values in. It's
contro source is CALL_RESULTS - working fine
6) COMMENTS: from tblResumes, but can be update via this form - working fine

Klatuu said:
Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

Rod said:
I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

Klatuu said:
A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

:

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

Okay, now we are moving forward. It appears this is, indeed, an unbound
form. I am assuming this script capability some something new you are
adding.

I think rather than using the code I sent earlier, we should use a different
method. It will avoid having to do the coding to open the table and close it.

Also, I am not sure what "My Text #3 and My Text #4 are. What I am thinking
is that the ID field in tblScripts identifies which script you want, and the
Msg is the verbage of the script. So what I am thinking is that you want to
find the ID number that corresponds to the Option Button selected. The code
below will accomplish that. If that is not

In the After Update event of the Option Group (not the click):

Me.Text131 = DLookUp("[Msg]","tblScripts","[ID] = " & Me.OptiogGoupName)

Let me know if this will help.

Rod said:
5 records in tblScripts
1) txtDialNumber control source is DIAL NUMBER. It is getting this number
by concatenating 1+AREA_CODE+INPUT_NUMBER(from a different form). - working
fine.
2) DNC is determine by an update query which looks at a list of numbers and
marks the DNC field as True in tblResume if the AREA_CODE+INMPUT_NUMBER are
found in the DNC list. - working fine.
3) CANDIDATE gets its value from tblResume Candidate name - working fine.
4) CALLED_ON gets its value from tblResume Called_On. This form can update
that value - working fine. Same thing for Call_Return and CO.
5) CAL RESULTS: when I created this combo box I put the values in. It's
contro source is CALL_RESULTS - working fine
6) COMMENTS: from tblResumes, but can be update via this form - working fine

Klatuu said:
Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

Rod said:
I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

:

A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

:

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

YES! YES! YES! (happy danceing around my chair)

That is great!

The only issue I see is the paragraph formatting of the script is not
preserved. How can I preserve the new paragraphs and skipped lines in the
Msg memo? Nail that and check the skies for fireworks!

Klatuu said:
Okay, now we are moving forward. It appears this is, indeed, an unbound
form. I am assuming this script capability some something new you are
adding.

I think rather than using the code I sent earlier, we should use a different
method. It will avoid having to do the coding to open the table and close it.

Also, I am not sure what "My Text #3 and My Text #4 are. What I am thinking
is that the ID field in tblScripts identifies which script you want, and the
Msg is the verbage of the script. So what I am thinking is that you want to
find the ID number that corresponds to the Option Button selected. The code
below will accomplish that. If that is not

In the After Update event of the Option Group (not the click):

Me.Text131 = DLookUp("[Msg]","tblScripts","[ID] = " & Me.OptiogGoupName)

Let me know if this will help.

Rod said:
5 records in tblScripts
1) txtDialNumber control source is DIAL NUMBER. It is getting this number
by concatenating 1+AREA_CODE+INPUT_NUMBER(from a different form). - working
fine.
2) DNC is determine by an update query which looks at a list of numbers and
marks the DNC field as True in tblResume if the AREA_CODE+INMPUT_NUMBER are
found in the DNC list. - working fine.
3) CANDIDATE gets its value from tblResume Candidate name - working fine.
4) CALLED_ON gets its value from tblResume Called_On. This form can update
that value - working fine. Same thing for Call_Return and CO.
5) CAL RESULTS: when I created this combo box I put the values in. It's
contro source is CALL_RESULTS - working fine
6) COMMENTS: from tblResumes, but can be update via this form - working fine

Klatuu said:
Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

:

I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

:

A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

:

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
R

Rod

I figured this one out! We are DONE! I hope you guys out there realize how
many people you make happy every time you work with someone! I am very glad
you are there! Have a great day!

- Rod

Rod said:
YES! YES! YES! (happy danceing around my chair)

That is great!

The only issue I see is the paragraph formatting of the script is not
preserved. How can I preserve the new paragraphs and skipped lines in the
Msg memo? Nail that and check the skies for fireworks!

Klatuu said:
Okay, now we are moving forward. It appears this is, indeed, an unbound
form. I am assuming this script capability some something new you are
adding.

I think rather than using the code I sent earlier, we should use a different
method. It will avoid having to do the coding to open the table and close it.

Also, I am not sure what "My Text #3 and My Text #4 are. What I am thinking
is that the ID field in tblScripts identifies which script you want, and the
Msg is the verbage of the script. So what I am thinking is that you want to
find the ID number that corresponds to the Option Button selected. The code
below will accomplish that. If that is not

In the After Update event of the Option Group (not the click):

Me.Text131 = DLookUp("[Msg]","tblScripts","[ID] = " & Me.OptiogGoupName)

Let me know if this will help.

Rod said:
5 records in tblScripts
1) txtDialNumber control source is DIAL NUMBER. It is getting this number
by concatenating 1+AREA_CODE+INPUT_NUMBER(from a different form). - working
fine.
2) DNC is determine by an update query which looks at a list of numbers and
marks the DNC field as True in tblResume if the AREA_CODE+INMPUT_NUMBER are
found in the DNC list. - working fine.
3) CANDIDATE gets its value from tblResume Candidate name - working fine.
4) CALLED_ON gets its value from tblResume Called_On. This form can update
that value - working fine. Same thing for Call_Return and CO.
5) CAL RESULTS: when I created this combo box I put the values in. It's
contro source is CALL_RESULTS - working fine
6) COMMENTS: from tblResumes, but can be update via this form - working fine

:

Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

:

I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

:

A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

:

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 
K

Klatuu

Good new, Rod!, Glad you got it working. I was getting worried about this
one. I'm really happy to find out we got it done.

Rod said:
I figured this one out! We are DONE! I hope you guys out there realize how
many people you make happy every time you work with someone! I am very glad
you are there! Have a great day!

- Rod

Rod said:
YES! YES! YES! (happy danceing around my chair)

That is great!

The only issue I see is the paragraph formatting of the script is not
preserved. How can I preserve the new paragraphs and skipped lines in the
Msg memo? Nail that and check the skies for fireworks!

Klatuu said:
Okay, now we are moving forward. It appears this is, indeed, an unbound
form. I am assuming this script capability some something new you are
adding.

I think rather than using the code I sent earlier, we should use a different
method. It will avoid having to do the coding to open the table and close it.

Also, I am not sure what "My Text #3 and My Text #4 are. What I am thinking
is that the ID field in tblScripts identifies which script you want, and the
Msg is the verbage of the script. So what I am thinking is that you want to
find the ID number that corresponds to the Option Button selected. The code
below will accomplish that. If that is not

In the After Update event of the Option Group (not the click):

Me.Text131 = DLookUp("[Msg]","tblScripts","[ID] = " & Me.OptiogGoupName)

Let me know if this will help.

:

5 records in tblScripts
1) txtDialNumber control source is DIAL NUMBER. It is getting this number
by concatenating 1+AREA_CODE+INPUT_NUMBER(from a different form). - working
fine.
2) DNC is determine by an update query which looks at a list of numbers and
marks the DNC field as True in tblResume if the AREA_CODE+INMPUT_NUMBER are
found in the DNC list. - working fine.
3) CANDIDATE gets its value from tblResume Candidate name - working fine.
4) CALLED_ON gets its value from tblResume Called_On. This form can update
that value - working fine. Same thing for Call_Return and CO.
5) CAL RESULTS: when I created this combo box I put the values in. It's
contro source is CALL_RESULTS - working fine
6) COMMENTS: from tblResumes, but can be update via this form - working fine

:

Great, thanks. I think we are moving forward. It is stll important to know,
however how the form gets its data, how it updates it, and how it know which
script to use.
How many records are in tblScripts?
Do any of the controls have anything in the control source property in the
properties dialog? If not we will have to go through the code to see how it
is working.

:

I miss spoke. The Field Names are "ID" and "Msg".

Other controls on form frmCalling:
1) Dial number: displays the number to call
2) Check Box DNC: check to see if the number to call is in another table.
If so a "True"
3) Text Box txtbxCandidate: Name of person assigned to dial number
4) Text Box txtbxCalled_On: date when the call was made
5) Combo Call results: predefined list of results of the call
6) txtbxCO: text box for interview date
7) tctbxComments: Comments
8) txtbxCall_Return: date call was returned
9) Frame124: option group of buttons to display scripts 1 - 4 in text131
10) Text131: large text box for the script selected by the frame124 option
group
11) Text135: just a test to see what value Frame 124 is, i.e. 1,2,3, or 4
depending on which of the 4 buttons was selected. This will eventually be
deleted.

Thanks for your help!

:

A field can't have records. A field is an object in a table.
Open tblScripts in design mode and see what the fields really are.
What other controls do you have on the form and what do they do. I am
sorry, Rod, but this is not making much sense to me.

:

tblScripts has two fields: 1) ID and 2)Msg. Msg has 4 records holding 4
scripts.

If this is not the best/easiest way to do this PLEASE let me know.

No luck on finding if something is bound. I checked the properties of the
form but no luck. Is this something I would have set?

I checked the form, option group, and text box and on the first it is not
listed as a property, and the later two are both clear.

My guess was since the option graoup would bet set to 1,2,3, or 4 I would be
able to then retrieve script 1,2,3, or 4. Again, if there is a better/easier
way, let's go for it.

:

Now I am getting confused. What second script? I thought there were only 2
fields in the table, an ID and Msg.
You can tell if it is bound by looking at the record source of the form. If
it has no record source, then it is unbound. The look at the controls on the
form to see what the control sources are.

You are trying to talk to a RecordSet (table) that is not open or not
visible to the code trying to address it. That is why you are getting the
errors. It is going to be difficult to help, not knowing how the form works,
what data it is using, and how it knows which row in tblScript is the current
row.

:

Sorry, Where can I find if it is bound or unbound? The control source for
text131 is blank. Does joining have anything to do with this problem? bare
with me because I really need the help!

I do not know why case 1 & 2 return the same message. The memo text are
different. Perhaps it never finds case 2 and the message is a leftover from
case 1.

Well, when I press the second button I would like to have the form bring
back the second script.

:

I think this may be the problem. It may be a plain table, but to use it,
either your form has to be bound to it or you have to have it open as a
recordset. Before we can fix this, I need information:
Is your form bound or unbound?
If it is bound, what is the record source?
If it is bound, what is the control source for Text131?
Why do cases 1 and 2 return the same thing?
How do you know what row you are on?

:

I lookup up what a "recordset" is and wouldn't know how to do that.
tblScripts is just a plan table with two fields:
1) ID generated by access as the key with no modifications by me.
2) Msg of type memo and no other special settings than the defaults.

:

Do you have tblScript open as a recordset?
Does it have a field named Msg?

:

If your code is in the form with Text131:
Me.Text131 = tblScripts]![MSG]
If it is in a different form:
forms!FormNameWhereText131Is!Text131 = [tblScripts]![MSG]

:

I HAVE BEEN WORKING ON THIS SIMPLE PROBLEM FOR DAYS!!!

****All I want to do is when a user selects option "X" for the option group:
1) that option group selection should go fetch the corresponding script from
tblScripts
2) display the approprate script from tblScripts in a text box on the form.

Table is names tblScripts with fields named ID (auto number) and Msg (memo).

My option group expression looks like this:
Private Sub Frame124_Click()
'MsgBox Frame124

Select Case Frame124
Case Is = 1
Text131 = [tblScripts.MSG]
Case Is = 2
Text131 = [tblScripts.MSG]
Case Is = 3
Text131 = "My Text # 3"
Case Is = 4
Text131 = "My Text # 4"
End Select

End Sub

The debuger comes up and complains about my "Text131 = [tblScripts.MSG]"
definition whenever I select an option.

Thanks.
 

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

Top