UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
3 Pages V < 1 2 3 >  (Go to first unread post)
   Reply to this topicStart new topic
> Invalid Use Of Null, Access 2016    
 
   
Phil_cattivocara...
post Sep 18 2019, 07:20 AM
Post#21



Posts: 363
Joined: 2-April 18



CODE
strSQL "INSERT INTO tblCareReviews...
you missed an equal sign
CODE
strSQL = "INSERT INTO tblCareReviews...


--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
mike60smart
post Sep 18 2019, 08:13 AM
Post#22


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi Phil

Ok now it reverts to the same Error 3075 in Post 16

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 10:11 AM
Post#23


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


Hi Mike,

Can you post the SQL output in the immediate window

Oops, you've already done it

--------------------


Regards,

David Marten
Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 11:35 AM
Post#24


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


That's a weird one, Mike.

What is highlighted when that error pops up?

Also, is the PK field called 'CareReviewsID' or 'CareReviewID'?

You have it spelt one way in Post#14 and the other in Post#20.

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 18 2019, 12:03 PM
Post#25


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

The error Pops up and it does not highlight anything at all

PK is CareReviewsID

The Immediate Window shows this:-

CODE
INSERT INTO tblCareReviews (Resident_FK, ReviewDate, PrimaryComorbidities, NursingCaseMixCategory_FK, SkilledNsg, NursingCareNeedsNotes,  TherapyCareNeedsNotes, SkilledOT, OTProjectedSched , SkilledPT, PTProjectedSched, SkilledSLP, SLPProjectedSched, PriorSetting , EstimatedTimeFrame,  100thDayDateActual, LastCoveredDay, DischargePlan, DischargeLocation, AreasofFocusConcern, CareConferences)  SELECT cr.Resident_FK, cr.ReviewDate,  cr.PrimaryComorbidities, cr.NursingCaseMixCategory_FK, cr.SkilledNsg, cr.NursingCareNeedsNotes, cr.TherapyCareNeedsNotes, cr.SkilledOT, cr.OTProjectedSched ,  cr.SkilledPT, cr.PTProjectedSched, cr.SkilledSLP, cr.SLPProjectedSched, cr.PriorSetting, cr.EstimatedTimeFrame, cr.100thDayDateActual, cr.LastCoveredDay,  cr.DischargePlan, cr.DischargeLocation, cr.AreasofFocusConcern, cr.CareConferences  FROM tblCareReviews cr  WHERE CareReviewsID = 15;



--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 12:41 PM
Post#26


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


Look at the beginning of line 30:

You have:
CODE
30    strSQL "INSERT INTO tblCareReviews ...


It should read:
CODE
30    strSQL = "INSERT INTO tblCareReviews ...


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 18 2019, 12:47 PM
Post#27


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

No the code is this:-

CODE
Private Sub cmdD_Click()
10    On Error GoTo cmdD_Click_Error

      Dim strSQL As String

20    If Me.Dirty Then Me.Dirty = False


30    strSQL = "INSERT INTO tblCareReviews (Resident_FK, ReviewDate, PrimaryComorbidities, NursingCaseMixCategory_FK, SkilledNsg, NursingCareNeedsNotes, " _
        & " TherapyCareNeedsNotes, SkilledOT, OTProjectedSched , SkilledPT, PTProjectedSched, SkilledSLP, SLPProjectedSched, PriorSetting , EstimatedTimeFrame, " _
        & " 100thDayDateActual, LastCoveredDay, DischargePlan, DischargeLocation, AreasofFocusConcern, CareConferences) " _
        & " SELECT cr.Resident_FK, cr.ReviewDate, " _
        & " cr.PrimaryComorbidities, cr.NursingCaseMixCategory_FK, cr.SkilledNsg, cr.NursingCareNeedsNotes, cr.TherapyCareNeedsNotes, cr.SkilledOT, cr.OTProjectedSched , " _
        & " cr.SkilledPT, cr.PTProjectedSched, cr.SkilledSLP, cr.SLPProjectedSched, cr.PriorSetting, cr.EstimatedTimeFrame, cr.100thDayDateActual, cr.LastCoveredDay, " _
        & " cr.DischargePlan, cr.DischargeLocation, cr.AreasofFocusConcern, cr.CareConferences " _
        & " FROM tblCareReviews cr " _
        & " WHERE CareReviewsID = " & Me.CareReviewsID & ";"
            

40    Debug.Print strSQL
50    CurrentDb.Execute strSQL, dbFailOnError
60    MsgBox "Remember to update the Review date as necessary!!", vbCritical

70    Forms![frmResidentCareReviews].[frmCareReviewsSubform].Form.Requery
80    DoCmd.GoToRecord , , acLast
90    Me.ReviewDate.SetFocus
100   Exit Sub

cmdD_Click_Error:
110   MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdD_Click, line " & Erl & "."

End Sub

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 12:53 PM
Post#28


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


Not in Post#20, it wasn't!

--------------------


Regards,

David Marten
Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 12:55 PM
Post#29


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


With the code in Post#27 I can not duplicate a compile error.

There must be a syntax error elsewhere in your code.

Otherwise, perhaps save everything and do a compact and repair.

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 18 2019, 01:48 PM
Post#30


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

Did a Compact & Repair and still no joy

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 02:05 PM
Post#31


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


What happens when you do Debug->Compile ?

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 18 2019, 02:16 PM
Post#32


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

I commented out all code and then did a Compile.

No errors found.

Run the On Click Event and same result


--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 02:18 PM
Post#33


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


Even with the code commented out?

Do you know how to decompile? If so, perhaps worth a shot, then C&R then compile again.

If not, perhaps it's time to start importing objects into a new database.

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 18 2019, 02:31 PM
Post#34


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

Here with a stripped down example

Attached File  Test.zip ( 52.26K )Number of downloads: 4

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
cheekybuddha
post Sep 18 2019, 04:36 PM
Post#35


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


Hi Mike,

It looks like you are using a newer version of Access than I am able to read (I only have A2007 here at home).

On opening your db I get the message: 'The Microsoft Office Access database Engine cannot read the data in Residentstbl. Then minimum required version to read the data is 14.0'

Are you using any special features in your table like multi-valued fields etc?

I'll try and have a look at it where I'm working tomorrow. I think they may have Access 2016.

Otherwise, someone else may have a peek in the meanwhile.

@Phil, are you still checking in on this thread?

d

--------------------


Regards,

David Marten
Go to the top of the page
 
Phil_cattivocara...
post Sep 19 2019, 03:07 AM
Post#36



Posts: 363
Joined: 2-April 18



QUOTE (cheekybuddha)
@Phil, are you still checking in on this thread?

and @mike60smart too: yesterday I stopped to follow this thread for other commitments and... italian time zone (I was sleeping!!!! )
I read last post only, so I answered: keep going on without me, do not care. As soon as I can (and if I have something useful to say, of course) I will post again.

--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
cheekybuddha
post Sep 19 2019, 03:29 AM
Post#37


UtterAccess VIP
Posts: 11,533
Joined: 6-December 03
From: Telegraph Hill


@Phil, Great! thumbup.gif

Just wondered if you were able to check Mike's attachment in Post#34.

>> As soon as I can (and if I have something useful to say, of course) I will post again. <<
Yes, please! hat_tip.gif

--------------------


Regards,

David Marten
Go to the top of the page
 
mike60smart
post Sep 19 2019, 04:47 AM
Post#38


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi David

No there are no special fields like MVF etc


--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
Phil_cattivocara...
post Sep 19 2019, 07:13 AM
Post#39



Posts: 363
Joined: 2-April 18



QUOTE (cheekybuddha)
Just wondered if you were able to check Mike's attachment in Post#34.
Done! A2016 can do it.
Residentstbl has calculated field, 100thDayDateCalculated with Expression: [AdmitDate]+100.
Calculated fields require A2010 or newer.
Let me read the whole post and if I can do anything... I will do.
This post has been edited by Phil_cattivocarattere: Sep 19 2019, 07:13 AM

--------------------
Please forgive in advance my horrible English.
Go to the top of the page
 
mike60smart
post Sep 19 2019, 11:36 AM
Post#40


UtterAccess VIP
Posts: 13,419
Joined: 6-June 05
From: Dunbar,Scotland


Hi Phil & David

I have managed to solve my problem byusing the following Code:-

CODE
Private Sub cmdDup_Click()
On Error GoTo cmdDup_Click_Err

    On Error Resume Next
    DoCmd.RunCommand acCmdSelectRecord
    If (MacroError = 0) Then
        DoCmd.RunCommand acCmdCopy
    End If
    If (MacroError = 0) Then
        DoCmd.RunCommand acCmdRecordsGoToNew
    End If
    If (MacroError = 0) Then
        DoCmd.RunCommand acCmdSelectRecord
    End If
    If (MacroError = 0) Then
        DoCmd.RunCommand acCmdPaste
    End If
    If (MacroError <> 0) Then
        Beep
        MsgBox MacroError.Description, vbOKOnly, ""
            End If
DoCmd.GoToRecord , , acLast
Me.ReviewDate.SetFocus

cmdDup_Click_Exit:
    Exit Sub

cmdDup_Click_Err:
    MsgBox Error$
    Resume cmdDup_Click_Exit
End Sub


Many thanks for looking at this.
cheers.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
3 Pages V < 1 2 3 >


Custom Search


RSSSearch   Top   Lo-Fi    20th October 2019 - 07:03 AM