reports on added records not appearing

groengoen

Registered User.
Local time
Today, 09:06
Joined
Oct 22, 2005
Messages
141
I have installed a split database mde as a runtime version on a users network, but I have had a major problem. When I key in new records and try to look at them with a report, nothing appears, although when I look at the input form the records are there. The report should open in preview mode, but nothing actually happens, no blank page of report, just an empty window. The tables are on a back-end on a server with the front-end on the users pc. I was wondering if this is possibly due to permissions on the server, but don't know where to start. Because it is an mde I can't see what is in the tables. I have done a test on my test machine and it seems to work perfectly there, where it is running as a split mde with the be on a drive on my network. Any ideas anybody. I would love to upload the software but I have signed a confidentiality clause.
 
Is the server location in a trusted location?

If you run an mdb/accdb in the same config does it work?

David
 
I haven't tried that but what do you mean by a trusted location?
 
is it your database, or has this been provided for you?

if its yours, then someone should have the code - the developer wont work from an mde

--------
do you have any record locking in place - maybe the new entry being open locks a file, so that the report cant complete properly?

do you know what the underlying query is for the report - does this open? - idf the query wont open, then the report wont either.
 
It is my database, and I have the code, I am the developer. There is locking in place, but I close the entry form before trying the report, as only one window is visible at a time. I will look at the underlying query, but how will I know whether it has been opened or not in the mde?
 
On top of that it works ok on my test machine and my test network, so I was thinking maybe it is something to do with whether it is "trusted" or not or permissions on the server. How would I check this.
 
This is the code for the exiting the input form. I note that I don't haven't closed the recordset or set it to nothing. Maybe this is part of the problem?

Code:
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
    Dim rst As ADODB.Recordset
    Dim strSQL As String
    strSQL = "[MemberNumber] = " & Me.MemberNumber
    
    'Duplicate Member?
    'instantiate a recordset for the Member table
    Set rst = New ADODB.Recordset
                
    With rst
        .ActiveConnection = CurrentProject.Connection
        .CursorType = adOpenKeyset
        .LockType = adLockOptimistic
        .Open "Select * from tblMember"
        'Attempt to find this member
        .Find strSQL
    End With
    If Not rst.EOF Then
        MsgBox Me.MemberNumber & " Already a member! Try again"
        Me.MemberNumber.SetFocus
        Exit Sub
    End If
    Set rst = Nothing
    
    'Check if null or Zero
    Dim response As Integer
    If Me.MemberNumber = "" Or Me.MemberNumber = 0 Then
        response = MsgBox("Invalid MemberNumber! Click OK exit, Cancel to try again!", vbOKCancel)
        If response <> vbOK Then
            Me.MemberNumber.SetFocus
            Exit Sub
        End If
    End If
    'Check if Surname has  been input
    If IsNull(Surname) Or Me.Surname = "" Then
        MsgBox "Surname not  entered! "
        Me.Surname.SetFocus
        Exit Sub
    End If
    'Check if Forenames has  been input
    If IsNull(Forenames) Or Me.Forenames = "" Then
        MsgBox "Forenames not  entered! "
        Me.Forenames.SetFocus
        Exit Sub
    End If
    'Check if Title has  been input
    If IsNull(Title) Or Me.Title = "" Then
        MsgBox "Title not  entered! "
        Me.Title.SetFocus
        Exit Sub
    End If
    'Check if DoB has  been input
    If IsNull(DoB) Or Me.DoB = "" Or Me.DoB = 0 Then
        MsgBox "Date of Birth not  entered! "
        Me.DoB.SetFocus
        Exit Sub
    End If
    'Check if Phone Number have  been input
    If IsNull(PhoneNumber) Or Me.PhoneNumber = 0 Or Me.PhoneNumber = "" Then
        MsgBox "Phone Number incorrect ! "
        Me.PhoneNumber.SetFocus
        Exit Sub
    End If
    'Check if Address lines have  been input
    If IsNull(Address1) Or Me.Address1 = "" Or Me.Address1 = "" Then
        MsgBox "Address incorrect ! "
        Me.Address1.SetFocus
        Exit Sub
    End If
    If IsNull(Address2) Or Me.Address2 = "" Or Me.Address2 = "" Then
        MsgBox "Address incorrect ! "
        Me.Address2.SetFocus
        Exit Sub
    End If
'    If IsNull(Address3) Or Me.Address3 = "" Or Me.Address3 = "" Then
'        MsgBox "Address incorrect ! "
'        Me.Address3.SetFocus
'        Exit Sub
'    End If


    DoCmd.Close

Exit_cmdExit_Click:
    Exit Sub

Err_cmdExit_Click:
    MsgBox Err.Description
    Resume Exit_cmdExit_Click
    
End Sub
 
on the point of closing and setting recordsets to nothing, what is the default action if you forget to do this and the module is closed and re-opened with a "new" recordset each time?
 
are you using ADO generally? are you using unbound forms?
 
Sorry. I have been delayed. I use unbound forms with the occasional dip into ADO. This is the code I use for adding the new record:

Code:
    DoCmd.GoToRecord , , acNewRec
 

Users who are viewing this thread

Back
Top Bottom