Results 1 to 9 of 9
  1. #1
    Join Date
    May 2003
    Posts
    19

    Unanswered: One form, more than one RecordSource?

    I'm using queries to populate some texboxes on my form. The RecordSource is set to tblAlpha for those queries. But I would like to do the save with tblBravo and perhaps tblCharlie.

    I don't want to use subforms. Is there a way to have the form cope with 2 or more tables please?

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Yes, but you must use a Botton with some code for tell to the form what
    recordsource must use.
    Saludos
    Norberto

  3. #3
    Join Date
    May 2003
    Posts
    19
    Thanks very much, Norberto. Cheers

  4. #4
    Join Date
    Oct 2003
    Location
    Derry, Northern Ireland
    Posts
    18
    wot kind of code would you use? i have just came across the same problem!
    Take 'er handy!

  5. #5
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Coopstar
    wot kind of code would you use? i have just came across the same problem!

    This is an sample of the code:

    Private Sub Recorrido_AfterUpdate()

    Dim Valor As Variant
    Valor = Me!Recorrido
    If IsNull(Valor) Then
    Me.RecordSource = "Consulta Asignaciones Altas"
    Else
    Me.RecordSource = "Consulta Asignaciones Altas Recorrido"
    End If

    End Sub
    Saludos
    Norberto

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    If some TextBoxes are bounded with a table and you change the recordSource of the form, these TextBoxes will have no data and also an error because they are bounded to another RS which is not the actual one

    Hope I could express what I mean...

  7. #7
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    hammbakka
    Is not easy:
    1)In the Form must not have any RecordSource.
    2) In the Header of that form you must make a control do by certains
    condition what RecordSource must use the form.
    3) Enable the Detail of the form when you uptate the control of point 1).
    If you want i send an sample of that, but not now because i must go.

    ok
    Saludos
    Norberto

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Norberto,
    I agree with you, it is not easy to do that. Ok thanks for your offer. I can get a code form you.

  9. #9
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    hammbakka :
    I do it, two in one.
    1)The form is "AltasCD Masivos"
    2) When you open the form if you selecc in the control "Recorrido" one the RecordSource is by recorrido, if that control is null, the RecordSource is other.
    That all, see the code.
    Attached Files Attached Files
    Saludos
    Norberto

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •