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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid populating checkboxes

Status
Not open for further replies.

sfunk

Technical User
Jan 22, 2002
107
0
0
US
Hello,

On the MSHFlexGrid Click I am trying to populate text boxes and checkboxes.

I figured out how to put text into a text box but not how to set the value of a checkbox.

Here is the code:
Code:
Private Sub MSHFlexGrid1_Click()

With MSHFlexGrid1
            
   .Col = 0
      txtJobID.Text = .Text
   .Col = 1
      txtCompany.Text = .Text
   .Col = 2
      txtContact.Text = .Text
   .Col = 3
      txtTitle.Text = .Text
   .Col = 4
      txtOpenDate.Text = .Text
   .Col = 5
      txtAddress.Text = .Text
   .Col = 6
      txtPhone.Text = .Text
   .Col = 7
      txtFax.Text = .Text
   .Col = 8
      txtEmail.Text = .Text
   .Col = 9
      txtURL.Text = .Text
   .Col = 10
      txtCorpURL.Text = .Text
   .Col = 11
      chkResumeSent.Value = .Text
   .Col = 12
      chkFirstCall.Value = .Text
   .Col = 13
      chkSecondCall.Value = .Text
   .Col = 14
      chkLastCall.Value = .Text
   .Col = 15
      chkActionPending.Value = .Text
   .Col = 16
      txtInterviewDate.Text = .Text
   .Col = 17
      chkFollowUpCall.Value = .Text
   .Col = 18
      chkFollowUpCall2.Value = .Text
   .Col = 19
      txtHEarFromDate.Text = .Text
   .Col = 20
      txtNotes.Text = .Text
      
End With

End Sub

Thank you for any suggestions.

Sincerely,
Steve
Sincerely,
Steve Funk
 
What's the value of the text that your trying to assign to the check box? It needs to be 0 or 1, not true or false.
 
For clarity use vbChecked, vbUnchecked and vbGrayed (built in constants) for state of checkboxes Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Response to CoCo86
In the database I believe I have it as True/False not 1/0. I can change that easy enough.

Could you show an example?

Response to johnwm

Could you show a couple of examples by changing the code that I originally posted?

Thank you both for your help

Sincerely,
Steve
Sincerely,
Steve Funk
 
Private Sub MSFlexGrid1_SelChange()

Check1.Value = vbUnchecked
Check1.Move MSFlexGrid1.Left + MSFlexGrid1.CellLeft, MSFlexGrid1.Top + MSFlexGrid1.CellTop, MSFlexGrid1.CellWidth, MSFlexGrid1.CellHeight



End Sub
 
Thank you for responding.

I am very new to programming. Could you give that example in the context of my original example. Such as.

What I have happening is when a row in the grid is clicked it populates textboxes and I need to do the same for chkboxes. so a check box that I have is coming from a .col = 18 from the grid. I want the checkbox to reflect the value from the grid.

This works:
.Col = 5
txtAddress.Text = .Text

This doesn't:

.Col = 18
chkFollowUpCall2.Value = .Text

Thank you,
Steve Sincerely,
Steve Funk
 
This works:
.Col = 5
txtAddress.Text = .Text

This doesn't:


.Col = 18

This Should Works
if .Text = 1 then

chkFollowUpCall2.Value = VBChecked

elseif .Text = 0 then

chkFollowUpCall2.Value = VBUnChecked

else

chkFollowUpCall2.Value = VBGrayed

end if


Bye
miq

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top