473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Linking tables

Hi

Please can someone help me?!! For some reason I cant get my two data input forms to link on a ID value. I'm sure I have done this before, but for some reason I can get it to work and im ready to pull my hair out!!!

--Customer table
*AccID
Name
Contact Address etc

--Properties table
*PropID
AccID
Address etc

I have two tables, Customers and Properties (one to many, linked via AccID), I then have a form for each. I want the user to input customer details then (via a button) go to the property form to add a property for that customer. I dont want the user to see the AccID field in the properties form (I want it to be linked to AccID on the customers form and automatically populated).

Any help would be FANTASTIC!!
Many Thanks
Jane
Feb 5 '09 #1
3 1103
ChipR
1,287 Expert 1GB
DoCmd.OpenForm "Properties Form Name", , , , acFormAdd
Forms("Properties Form Name")![AccID] = AccID

You can have AccID locked/hidden on the properties form, one you see that it is getting the correct value.
Feb 5 '09 #2
Thank you I have it working now.

also wonder if you can help me with this.
When I open a create customer account form, I want the main menu form to close, same as when I close/cancel the new customer account form I want it to close then open the main menu. (as well as ask the user if they are sure?)

This seems really simple stuff but i cant get it working !!!!!! aaarrgghhh!! ive taken code from a prev db i've done (which works and it doesnt work the same on my current one!!! im sure its something daft im not getting!
Feb 8 '09 #3
ChipR
1,287 Expert 1GB
It sounds like you could set your new form to modal rather than close and then open your other form. That prevents users from doing anything to other forms while this one is open. It's on the Form Properties -> Other tab.

You can put this code in your button and disable/hide the control box and close button of the form.
Expand|Select|Wrap|Line Numbers
  1. Dim iResponse as Integer
  2. iResponse = MsgBox("Are you sure that you want to do this?", _
  3.     vbYesNo, "Confirmation")
  4. If iResponse = vbNo Then
  5.     Exit Sub
  6. End If
Feb 9 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John South | last post by:
I have an Access 2000 front end that I wish to work with a SQL Server 2000 database by means of Linked tables. Do I have to use an ODBC connection to SQL Server? It seems to be the only option...
2
by: Jeff Pritchard | last post by:
Some time ago I am sure I came across something that said this was possible, though it doesn't seem to work. A client wants to replace an Access back-end with SQL Server tables. We have tried...
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
18
by: Mark P | last post by:
I have a bit of vb code that uses Tables.Append to programatically link tables from Oracle and DB2 datasources. The problem I am having on some client machines is that the link will take anywhere...
2
by: Matthew Wells | last post by:
Good morning... I have an Access front end that uses SQL Server linked tables. SQL Server uses Windows authentication. I have one Windows group that all Access users are a member of. I added...
2
by: TheTamdino | last post by:
One of the things that is common between most genealogy databases is that they will have one screen were you log all the information for a given person and then (maybe) have a link to a source...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
1
by: hmiller | last post by:
I'm sorry to populate the server with yet another question about linking multiple tables and queries, howerver I have not been able to find the right criteria. My problem. I am trying to...
1
by: deiopajw | last post by:
I have a Back end database on a network drive. The copies of the front end are located on individual pc's (in their C drive). The problem arises when a laptop user naturally hooks up to the...
3
by: ARC | last post by:
I'm having trouble here with Access 2007 and connecting to a different database. The code below works great IF the previous back-end database connection is still present and you are trying to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.