Stupid question but...

phillsheen

Registered User.
Local time
Today, 13:21
Joined
Jun 12, 2006
Messages
86
Hi everyone,

This is so simple but I cant get it to work for some reason so I'm probably over looking something really stupid.

Ive got two forms, one 'Members' and one 'Paymentdetails'. On the members form I have a button which when pressed should bring up that members payment details. This works on the first record but once I start adding the others members payment details it does not save them when I come back and press the button again. I have created a relationship between MemberID on Members and PaymentID on Paymentdetails.
This is such a simple thing to do Im kicking myself!

Please Help!

Phill
 
Use

DoCmd.OpenForm "Paymentdetails", acNormal,,"[MemberID]=" & Me.MemberIDTextBox
 
could add the save record function to the button? Would save the record before it does anything else
 
DoCmd.OpenForm "Paymentdetails", acNormal,,"[MemberID]=" & Me.MemberIDTextBox

I did this but it comes up with a 'Method or data member not found' for the Me.MemberIDTextBox part of code. Should I have a MemberId text box on the form? This field is an Autonumber.
Also do I need to keep the Relationship?

could add the save record function to the button? Would save the record before it does anything else

Entering the information does save the information in the table but it does not bring it back up when I press the button.

Thanks for the replies!

Phill
 
Sorry, try:

DoCmd.OpenForm "Paymentdetails", acNormal,,"[MemberID]=" & Me!MemberID

instead


Also, you need to requery your form once the changes have occured so if you need to requery the first form you would put this:

Forms!YourFirstFormNameHere.Requery

in the event where you have finished updating the other form. The Form's AfterUpdate event might be appropriate.
 
Hi,
Thanks for the quick replies but my problem is still here. Im not suret he code is exactly correct, this is what Ive got so far,
Code:
Private Sub Form_AfterUpdate()
    
    CallDisplayImage
    
    Forms!members.Requery
    

End Sub

Code:
Private Sub openpayments_Click()
On Error GoTo Err_openpayments_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

DoCmd.OpenForm "Paymentdetails", acNormal, , "[MemberID]=" & Me!MemberID
       stDocName = "Management toolbar"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_openpayments_Click:
    Exit Sub

Err_openpayments_Click:
    MsgBox Err.description
    Resume Exit_openpayments_Click
    
 
    
End Sub

Is this correct?
 
Can you run compact and repair and then zip with WinZip (or something like it) and then post it here (must be 393KB or less to post here).
 
Hi,
Thanks for the quick reply.

Ive attached the database, please excuse the mess but its still very much a work in progress. It has passwords on it, starting password is Username:owner password:swissball and the VB password is water.

Thanks for having a look I really appricate it.

Phill
 

Attachments

So, it looks like you put Access security on it (probably should wait to do that until AFTER it's ready) so I can't open it without the workgroup file that was created for it. So you'll have to post the mdw file for me to even try to open it.
 
One workgroup file!
Yeah I didnt actually mean to put security on the database, I was just playing around with it and kinda got carried away!

Cheers for the reply!
 

Attachments

Sorry - I've been pretty busy this weekend so I didn't have a chance to go in and check. I'll try to get to it today. If someone else gets there first that's great. I am sorry I can't give you info faster.
 
No problem bob.
Your replies are greatly appreciated!

Thanks again
Phill
 
Sorry it took so long.

Add this:
Forms!Payments.Membershipnumber = Me.MemNumber
Forms!Payments!MemberID = Me.MemberID

Under this:
DoCmd.OpenForm "Payments", acNormal, , "[MemberID]=" & Me!MemberID
 

Users who are viewing this thread

Back
Top Bottom