Aqui un ejemplo de creacion de credenciales escolares
form1
Private Sub Command1_Click()
If Data1.Recordset.EOF And Data1.Recordset.BOF Then
Else
Data1.Recordset.MoveFirst
While Not Data1.Recordset.EOF
If Text1(0) = Text2(0) Then
MsgBox "El registro a cido guardado"
Exit Sub
Else
Data1.Recordset.MoveNext
End If
Wend
End If
Data1.Recordset.AddNew
For i = 0 To 7
Text2(i) = Text1(i)
Next i
Data1.Recordset.Update
Data1.Recordset.MoveFirst
MsgBox "El registro a sido añadido"
End Sub
Private Sub Command2_Click()
Form3.Show
End Sub
Private Sub Command3_Click()
For i = 0 To 7
Text1(i) = ""
Next i
End Sub
Private Sub Command4_Click()
Form2.Show
End Sub
Form 2
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
While Not Data1.Recordset.EOF
If Text1 = Text2(3) Then
For i = 0 To 7
Form1.Text1(i) = Text2(i)
Next i
MsgBox "La busqueda a finalizado"
Me.Hide
End If
Data1.Recordset.MoveNext
Wend
End Sub
form 3
Private Sub Form_Load()
For i = 0 To 6
T1(i) = Form1.Text1(i)
Next i
x = Form1.Text1(7) & ".jpg"
Image2 = LoadPicture("C:\Imagenes\" & x)
res = MsgBox("¿Realmente quiere imprimir la credencial?", vbYesNo, "Imprimir")
If res = vbYes Then
MsgBox "La credencial de " & vbCrLf & Form1.Text1(0) & vbCrLf & "a sido impresa", vbInformation, "Imprimiendo"
Else
MsgBox "Impresion cancelada", vbInformation, "Cancelando impresion"
Me.Hide
End If
End Sub
Ya solo conoecta los textbox ect
*Necesitas la carpeta "C:\Imagenes" para que funciones