Hi all.
Your have to forgive me knowledge, has been a long time since writing VB
I have had to create a new contacts directory for a specific use.
One part is to have an external contact section.
Very simply user clicks a button to add a new user, new form loads with basic required fields.
When entered and click save it should save new record to table and appear on the main form in a list. However it does not show in the table.
But this does work for internal contacts - do figured perhaps a database table property issue, but cant see obvious problem, or perhaps code? But basically same for both functions.. I am stuck...
Code below:
From Parent form:
Your have to forgive me knowledge, has been a long time since writing VB
I have had to create a new contacts directory for a specific use.
One part is to have an external contact section.
Very simply user clicks a button to add a new user, new form loads with basic required fields.
When entered and click save it should save new record to table and appear on the main form in a list. However it does not show in the table.
But this does work for internal contacts - do figured perhaps a database table property issue, but cant see obvious problem, or perhaps code? But basically same for both functions.. I am stuck...
Code below:
From Parent form:
Code:
Private Sub New_Click()
DoCmd.OpenForm "External_Contact_New"
End Sub[CODE]
When completed fields click save
[CODE]Private Sub Save_Click()
Dim buff As String
On Error Resume Next
DoCmd.GoToRecord acDataForm, "External_Contact_New", acNewRec
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
DoCmd.Close acDataForm, "Form_Staff_Member_New"
Exit Sub
End If[CODE]
'moving data from buffer
[CODE]buff_drop
'save data
DoCmd.Save
Me.Refresh
Me.Requery
On Error Resume Next
Form_External_Contacts.Requery
buff = Form_External_Contacts.RecordSource
Form_External_Contacts.RecordSource = buff
'DoCmd.Close acForm, "External_Contact_New"
End Sub[CODE]
[CODE]Buff_Drop Details
Private Sub buff_drop()
Full_Name.Value = B_Full_Name.Value
First_Name.Value = B_First_Name.Value
Surname.Value = B_Surname.Value
Profile.Value = B_Profile.Value
Company.Value = B_Company.Value
Office_Tel.Value = B_Office_Tel.Value
Mobile_Work.Value = B_Mobile_work.Value
Mobile_Personal.Value = B_Mobile_personal.Value
Out_1.Value = B_Out_1.Value
Out_2.Value = B_Out_2.Value
Email.Value = B_Email.Value
Notes.Value = B_Notes.Value
End Sub[CODE]
Any Help would be appreciated, thank you in advance.
I have attached the zip containing files.
Thank you
Andrew
Attachments
Last edited: