Home > Software engineering >  How to get the form content in msgflexgrid form
How to get the form content in msgflexgrid form

Time:11-06

Want to enter information in the text, and then search for to the corresponding number in the form, and fill the corresponding data to other text, combo box, such as


If KeyCode=13 Then
'For the row=0 To 9
'For col=0 To 7
'n=s & lt;> M
'Next col
'the Next row
'the Else:
'Text4. Text=Form2. MSHFlexGrid1. TextMatrix (Form2. MSHFlexGrid1. Row 1, col)
'End If
'
'
'End If

'If KeyCode=13 Then
'If Form2. MSHFlexGrid1. TextMatrix (Form2. MSHFlexGrid1. Row, 7)=Text3. The Text Then
'Text4. Text=Form2. MSHFlexGrid1. TextMatrix (Form2. MSHFlexGrid1. Row, 8)
'the Else
MsgBox "XXX"
'End If
'End If

CodePudding user response:

CodePudding user response:

In fact is not difficult, very simple, but not clear, as you describe in the text into the information, you can't see in the picture that is text, is nothing more than to determine the field

CodePudding user response:

Equivalent to find, but I don't return value of the right, and Form2. MSHFlexGrid1. TextMatrix (Form2. MSHFlexGrid1. Row, 8). Let's say I in this line for several dozen ID64, I enter in the recipients of vv, carriage returns, line corresponding data of the 64 displayed on it at the same time, name, retail price, delivery, warehouse staff, customers,

CodePudding user response:

In MSHFlexGrid1_Click () event or "recipients" text Text1_LostFocus use SQL statements () event, test database "recipients are equal to
MSHFlexGrid1. TextMatrix (MSHFlexGrid1. Row, 8), and then detect the records corresponding to assign values to the various Combox controls and the Textbox control will can ah,

CodePudding user response:

In MSHFlexGrid1_Click () event I can use the event here, I mainly use the query function, and is in no point mshflexgrid click in the table, directly in the recipients of the text box input, will show the corresponding data, in the other box, respectively, I had a for statement is used to implement, but for statement I don't know the result, that is, the for 0 to??????? Step 1... In my case, are some of the data, I now can find the answer, but??? The number of surface instead of what you use? If let him look for to stop after the last record, watch the do while not eof (). But I don't know where is this use

CodePudding user response:

Dim lie As Integer
Dim heng As Integer
Dim s As String
Dim n As String
Dim m As String
'ubounde? +/-??? Lbound?? +/-???
Lie=Form2. MSHFlexGrid1. Row 'Rowe? AD cole? Oa
Heng=Form2. MSHFlexGrid1. Col.
'le=ubound - lbound + 1
'0 AD id
'1 AD? Who??
'2 AD Dio?
'3 AD a? E???
'4 AD 3?? Aeya?
'5 AD 3?? Ae???? U
'6 AD 3?? Ae???? Plus or minus
'7 AD aio? E?
'8 AD? I? §
'9 AD +? X ¢
S=Text3. Text
'the Do While o???
'
'Loop
If KeyCode=13 Then
'the Do While Not EOF ()
On Error GoTo err:
For lie=1 To Step 1
For heng=7 To 7 'aio? E?? U mu u7aD
M=Form2 MSHFlexGrid1. TextMatrix (lie, heng)
If s=m Then
Text4. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng + 1) '? I? §
Text1. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 4) 'a? E???
Combo3. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 1) '3?? Ae???? Plus or minus
Text2. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 3) '3?? Aeya?
Combo2. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 5) 'Dio?
Cob1. Text=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 6) '? Who??
Label9. Caption=Form2. MSHFlexGrid1. TextMatrix (lie, heng - 2) '3?? Ae???? U
End the If
Next heng
Next lie
'Loop
'the Else:
'MsgBox "x"
Err:
MsgBox "XXX"
End the If
End Sub

CodePudding user response:

reply to fifth floor llSnakesss

If you use the "query" button is much more convenient, such as:
 
Private Sub Command2_Click ()
'to connect to the database just
StrSQL="select * from table Where recipients='" & amp; Text2. Text & amp; "'" 'assumption that Text2. Text is recipients of Text box
RS. The Open strSQL, db, 2, 2
Text1. Text=RS! A field
Text3 Text=RS! A field
Combo1. Text=RS! A field
Combo2 Text=RS! A field
RS. CLOSE
End Sub

So that you know?
  • Related