Help with append queries and linking subforms

MelonFuel

Registered User.
Local time
Today, 19:05
Joined
Jun 15, 2012
Messages
31
Hi

I have created an Append Query.

the table tblQueue is the field where it keeps the data.

I have made a query from the tblQueue and that is now on the main form as a subform.

The subform isn't linked to anything via master and child.

There is a drop down list on a another subform that i think i need to link the data to.

Heres the code that i've used to run the append query.

Code:
Private Sub Append_Click()

stDocName = "qryOrderAp"
Docmd.OpenQuery stDocName, acNormal, acEdit
Me.Refresh

MsgBox "Done!"

End Sub

Any help would be appreciated.

Thanks.
 
hahah oh yeah :) thats what long days do to you :( will this is where im up to so far.

I'm trying to write an Append query that looks at data on subform Partschedule and populates the table that's part of the RecordSource for subform FrmQueue then refresh FrmQueue so that it shows the data.

The append button is on the main form because the subforms are in datasheet and are in a Tab control.

No need to check for duplicates.

Code:
Private Sub Append_Click()
Dim strSQL As String
  
  If IsNull(Me!cboModels) = True Then
    MsgBox "You must select a model first."
  Else
    strSQL = "INSERT INTO NameOfTable(NameOfField1, NameOfField2, NameOfField3) " & _
      "VALUES (" & Me!cboModels & ", " & Me!NameOfSomeother Control & ", " & Format(Date(), "\#yyyy\-mm\-dd\#") & ")"
    CurrentDb.Execute strSQL, dbFailOnError
    Me.Parent!FrmQueue.Requery
  End If
  
End Sub

This code was giving to me from Doug Steele and this is also what he has told me to supply for the code.

The Subform FrmQueue are called: tblQueue Query subform1

The Table being updated are called: tblQueue

The tables inside the table are called: PART, ModelNo

The combobox is called: cbomodel

i hope this defines i abit more because i agree the first post was very vague.

Thanks.
 
You still haven't asked a question. Are you receiving an error?

And what is your reason for not linking the subform to its parent form?
 

Users who are viewing this thread

Back
Top Bottom