Any Access 97 gurus here, i need some help

Confused

Elite Member
Nov 13, 2000
14,166
0
0
Hi

I am currently trying to do a little database in Access for a recording studio, and it has an artist table/form, where you can search for artists. also, there is "job" form, which lists the artist who is doing it, and what services they want.

what i want to do is to be able to search on the artists form, then click on the "New Job" button on that form, which loads up the job form, and pulls the data on the artist from the other form. i have managed to get it to pull the ArtistID, by setting the default value to be equal to the value in the ArtistID text box on the artist form

However, this does not enter any of the other details on the artist onto the form, such as name/address etc.

How could i do this?

Thanks in advance

ConfusedBW
 

IJump

Diamond Member
Feb 12, 2001
4,640
11
76
Are you designing this totally in Acces, or are you making the front end with VB or something like that? If you want the other artist info in the other feilds, can;t you set the default on those fields to the other fields in that particular table?



Then when you press the new button, it would bring up another form, and you can use the text in the fiels from the first form to fill in the appropriate in the "new job" form.

In VB, which is very similar to Access, it would be:

private sub form load

textfieldonform2_Artist.text = textfieldonform2_Artist.text

end sub

Or somthine roughly equivalent. Then when you write back to the data base, you would write a new record for the appropriate artist.


I could be wrong, since I am not sitting at a computer with either access or VB installed, but I thin kthat is pretty close.
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
we're doin it all in Access.

we could do it with setting the default value to be the contents of the other form, but i'm not sure whether it will all be saved when i close the form......:eek:


CBW
 

IJump

Diamond Member
Feb 12, 2001
4,640
11
76
What about writing a little code to write a record to the database when the 2nd Form closes with the contenet of the forms fields being written into the dtabase?
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
As IJump indicated, you need to read the relevant record somehow.

Either before setting up the new form and the presetting the defaults, or reading the desired record when you create the new form.
 

AlricTheMad

Member
Jun 25, 2001
125
0
0
Confused you should be able to
1: Grab a record set with the fields you want & pass that to the new form. In the 'open' event for the form write code to set the value of the text boxes to the appropritate field value.

or

2: send the artist ID to the new form & in the 'open' event write code to run an sql statement to get the feilds you need with the artist ID as criteria. Then set the value of the appropriate text boxes to the value of the fields.

or

3: If you are leaving the first form open put code in the 'open' event for the form that sets the value of the appropriate text boxes to the value of the text boxes on the first form.

Any questions let me know.

Alric the Self taught Access guru.
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
I've set default values for name, address, etc, that worked.

Now I can't enter any information in my subforms, brings up "you can't add or change a record because a related record is required in table ProfileTBL" (ProfileTBL being the table i want to add to


CBW
 

AlricTheMad

Member
Jun 25, 2001
125
0
0
Hmmmm not sure how you have your forms set up. Sounds like you need to make sure you have added the artist ID to the ProfileTBL to get started.

If you want to shooot me the file I could take a look at it.

PM me.

Alric