Relational Data

HI,

When I need a ComboBox for show a record from a related table (Calendars) in my form, I’m storing the id field in combobox.rowtag, for save after the user make a choice… Is the best option ? What is the “Best practice” for this situation ?

Example:

//Populate combo for calendar’s choice…
rsCalendarios = app.DBSelect(“Select Id, Nome from Calendarios”)
qtdCalendarios = rsCalendarios.RecordCount

If qtdCalendarios > 0 Then

For i As Integer = 1 To qtdCalendarios
  fieldName = rsCalendarios.Field("name").StringValue
  fieldId = rsCalendarios.Field("Id").IntegerValue
  cboCalendario.AddRow(fieldName)
  cboCalendario.RowTag(i - 1) = fieldId
  rsCalendarios.MoveNext
Next i

End If

Rowtag is the best place for this.

Thank’s Tim. I was not sure about it until now …