Problem with VBA

Pringle5555

New member
Local time
Today, 10:13
Joined
Sep 12, 2014
Messages
2
Hi Guys,

Ive got a strange one here. I have 2 machines with access 2007, 1 with 2010, and 2 with 2013. and my DB is a 2007 DB. I have it set up so I can open it on all the machines on the same time. This is all working fine with no problems.

I have 2 tables. A service record table and a jobsheet table. What I have been trying to achieve is auto population of things like name and address and phone numbers ect. from the service record table into a form for the jobsheet table. My problem is that I odnt have any fields in the table that are unique. either there is people who live in the same house or people with the same last names or people that share the same phone. I also dont have any unique identifiers for each record like record numbers or customer numbers ect.

The path I chose was to use the sirname to populate the rest of the information. and it works except for one little problem. if it is a common sirname like smith or jones or walker ect it will auto populate the the first record with that name instead of the one you click.

this is the first time I have used VBA so excuse my bad nameing. i know i should put cbosirname and things like that but its too late now haha. here is my VBA for that combo box.

My question is can I click the 3rd walker in the list and the 3rd walkers details populate. if not then can i create a second combo box in mobile phone number for example to narrow the results down to 1.

Thanks for your help guys
 
This is what ive got so far


Private Sub Last_Name_AfterUpdate()

Me.Last_Name.Value = Me.Last_Name.Column(0)
Me.Salutation.Value = Me.Last_Name.Column(1)
Me.First_name.Value = Me.Last_Name.Column(2)
Me.Contract_Reference.Value = Me.Last_Name.Column(3)
Me.Address_1.Value = Me.Last_Name.Column(4)
Me.Address_2.Value = Me.Last_Name.Column(5)
Me.Address_3.Value = Me.Last_Name.Column(6)
Me.City.Value = Me.Last_Name.Column(7)
Me.PostCode.Value = Me.Last_Name.Column(8)
Me.Referral.Value = Me.Last_Name.Column(9)
Me.Email.Value = Me.Last_Name.Column(10)
Me.Home_Tel.Value = Me.Last_Name.Column(11)
Me.Work_Tel.Value = Me.Last_Name.Column(12)
Me.Mobile.Value = Me.Last_Name.Column(13)

End Sub
 

Users who are viewing this thread

Back
Top Bottom