Invalid user of Null: Runtime error 94. Getting error when textbox is Blank. How to handle this error:

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Original code. username below is textbox name.
Please help.
Code:
[/FONT]
[FONT=Courier New]Private Sub Command9_Click()
If Me.Username.Value = "" Then MsgBox "Username cannot be blank", vbInformation, "OK?": Exit Sub
MsgBox Me.Username.Value
End Sub
 
Suppose i have a form in database1 and want to add the records to database2 then how is this achieved?
An alternative here is to link the table in Database1 to Database2 and run queries to extract your data as needed. No need for any VBA code to do this. You do not then have to re-enter or transfer any data. It will automatically update because it is linked.
Alan
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
An alternative here is to link the table in Database1 to Database2 and run queries to extract your data as needed. No need for any VBA code to do this. You do not then have to re-enter or transfer any data. It will automatically update because it is linked.
Alan

That is what I would do 99.99% of the time. You can open recordsets on tables in other databases if you really need to do so (here) Then instead of the current database you'd use the database you'd opened. If you are working with large scale projects with many users across a network, you can worry about all these remote connections using up resources. Otherwise, it's no big deal. Better to link tables though.
 
Upvote 0
Thanks again guys for the very usefull piece of information...

I have no idea till now how linking table works or how to even link it for the start:biggrin:

I have tried building append query, delete query etc. I tried append query to other database but wont work.

And what 'm trying to do is for users to have Database1 as frointEnd and Database2 as Main Database and then use Form in Database1 to run code and update records/data.

I am also wanting help in FORM pop up as soon as Database1 is open and then when form is close, i want event to triger and close Database1 too is that possible?


Thanks again Xen and Alan, I will also need link for linking tables maybe i'll need it soon.


THanks again
 
Upvote 0
Thanks again, now that I know few things i am sure I'll return with a lot of questions :biggrin: You guys have been very helpfull. God bless and enjoy Weekend!

I am going through the link.:)

Thanks again!
 
Upvote 0
Code:
[FONT=Courier New]Under the File menu, select "Get External Data" and then "Link Tables".[/FONT]


'm using Access 2007, 'm home now so where is "File menu"?:biggrin:
Tried searching but cant find link table too...

In case if you guys are still around then...:)

I think it is import access table in Access 2007 in external data tab, correct?
 
Upvote 0
That was it, I have linked it only to table [I also came to know that codes, queries etc too can be linked...]

Thanks again guys for giving me a start!!!!

You guys Rock!:)
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top